Skip to content
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

Add more reactive inspired functionality on Stream (and maybe Iterable) #30536

Open
lrhn opened this issue Aug 24, 2017 · 3 comments
Open

Add more reactive inspired functionality on Stream (and maybe Iterable) #30536

lrhn opened this issue Aug 24, 2017 · 3 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-2 library-async type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented Aug 24, 2017

Currently the simplest way to perform custom transformations of streams is to use the transform method.

someStream.transform(debounce(sec)).map(...).transform(switchLatest(...))

This is long and awkward compared to having the methods on the stream itself:

someStream.debounce(sec).map(...).switchLatest(...)

We should add more Rx inspired operations.

@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-m library-async type-enhancement A request for a change that isn't a bug labels Aug 24, 2017
@eernstg
Copy link
Member

eernstg commented Aug 24, 2017

Those methods would allow for late binding, of course, but if they only have a single implementation (they can still call methods on the Stream using late binding) then we could also express the transformations as functions without loss of expressive power:

switchLatest(map(debounce(someStream, sec), ...), ...)

and of course they could then be called using a BETA style "pipeline" syntax if we add something like the '->' that you've proposed:

someStream -> debounce(sec) -> map(...) -> switchLatest(...)

@dotdotcommadot
Copy link

Would definitely be nice if it were 'native' Dart.
Meanwhile you might want to have a look at https://github.com/ReactiveX/rxdart.

@lrhn lrhn added core-2 and removed core-m labels Sep 19, 2017
@loic-sharma
Copy link

loic-sharma commented Mar 20, 2018

In C#, the reactive functionality is added through extension methods. For example, here is C#'s Skip extension. This works really well - they've added extension methods for just about everything without cluttering their version of the Iterable type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-2 library-async type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants