floodfx / liveviewjs

LiveView-based library for reactive app development in NodeJS and Deno

Home Page:https://liveviewjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support async LiveViewComponentManager methods

juanpprieto opened this issue · comments

Hey Donnie,

First of all, thanks for putting this together. Love it.

While playing around with the examples (and inspecting the code for the Todo MVC demo), I noticed there are no examples which fetch data externally via async/fetch operations. What's the recommended/planned way of doing so?

I feel as if mount, render, handleEvent and handleInfo should all optionally support async signatures, so that one can actually fetch/push data from/to external sources/apis.

I'm new to Liveview (thanks for referencing the pragmatic series), so still trying to wrap my head around some of the more advanced concepts.

Once again, thanks for bringing this to node.

Hey @juanpprieto! Thanks for checking it out and the kind words!

Really great point on the async support. I will see what I can do over the next couple of days to add support for that. Thanks for bringing it up and adding an issue. If you get to it before I do, I am happy to review a PR.

@juanpprieto check out version 0.0.5. Added an example under src/examples/asyncfetch. LMK what you think.

@floodfx Looks great! — will play around with it and keep you posted.

Thanks for the quick turnaround!