You can convert an observable into an async iterator. You have to choose between discarding or buffering uniterated items
On 23 Mar 2018 14:39, "Bob Myers" <[email protected]> wrote: > Could someone jog my memory about proposals for better syntax for > observable mapping and subscribing, if any? > > I'm getting really tired of writing > > ``` > foo$.pipe(map(bar => mapper(bar))) > ``` > > I would much prefer to write something along the lines of > > ``` > stream function fooMapper(foo$) { > while async (const bar = foo$()) { > emit mapper(bar); > } > } > ``` > > Yes, I'm aware of all the potential issues here and this is just an > example, not an actual syntax proposal. I'm just wondering about any prior > art. > > Bob > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

