Open EricHurt opened 4 years ago
I have mentioned it https://github.com/ReactiveX/rxdart/issues/382#issuecomment-567823906 👍.
But Dart
has not Destructuring assignment syntax
(https://github.com/dart-lang/language/issues/207) like ES6, that makes the API not fluent
RxJS implemented the partition operator which creates two streams from a source and a predicate. It's something I've been waiting for, so I thought it would be useful in RxDart as well.
I put together a crude example below. Unfortunately, without destructuring, RxDart needs its own class for returning the streams. The example could probably be improved some, but the general idea is there.
An alternative is converting the class to a helper function that is imported by the Rx class and used Rx.partition => PartitionedStreams.