Open lrhn opened 7 years ago
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(...)
Would definitely be nice if it were 'native' Dart. Meanwhile you might want to have a look at https://github.com/ReactiveX/rxdart.
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.
Currently the simplest way to perform custom transformations of streams is to use the
transform
method.This is long and awkward compared to having the methods on the stream itself:
We should add more Rx inspired operations.