Skip to content

Support for async iterators #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RangerMauve opened this issue Apr 8, 2020 · 3 comments
Closed

Support for async iterators #276

RangerMauve opened this issue Apr 8, 2020 · 3 comments

Comments

@RangerMauve
Copy link

RangerMauve commented Apr 8, 2020

This library has been super helpful for loading data needed for various views in an app.

However, we've run into issues when it came to integrating asynchronous updates with everything.

It'd be cool if promiseFN could be extended with generatorFN which would be an async generator that would yield new data for the component to render and have react-async manage spinning it up and tearing it down.

Does this sound like it should belong in this library, or would it be better to spin out something new for this use case?

@ghengeveld
Copy link
Member

Hey, this is not currently supported by React Async, but it's part of the future plans. In fact there's a working implementation of subscriptions in an unreleased future version of the library. However, work on this is currently stalled, mostly due to uncertainty around Suspense and the appearance of React Query and SWR. Also React Async is currently implemented in TypeScript while this future version is in vanilla JS, and I'm not a TypeScript expert at all (I didn't do the migration to TS myself). So if you'd like to pick up the effort to get it into a shippable state (it's mostly feature complete already), I'd really really appreciate it. If not then this is probably going to take a while for me to get back to.

@RangerMauve
Copy link
Author

Thanks for the response! I actually ended up migrating to use-async-generator since it ended up fulfilling all my use cases with less overall code. 😅

@ghengeveld
Copy link
Member

Fair enough. Enjoy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants