-
Notifications
You must be signed in to change notification settings - Fork 16
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
Observables can be made async iterable by using a buffer #33
Comments
I have found this useful in the past, however I do think it would probably be worth forcing users to pick a queueing strategy rather than just being async iterable by default. Like depending on what's done with the events I've found all of these queueing strategies useful:
|
FWIW, source.flatMap(async (v) => {
await getSomething(v);
})
.subscribe({
next: sideEffect
})
// is functionally identical to
for await (const v of source) {
const result = await getSomething(v);
sideEffect(result);
} The major differences being that you're not allocating a |
FWIW: I'm 100% in favor of interop between different types. It's very useful. |
RxJS observables are async iterable (implemented using an unbounded buffer).
There's some good discussion of considerations and tradeoffs linked from that thread. Something to consider here.
is pretty cute.
The text was updated successfully, but these errors were encountered: