asynquence icon indicating copy to clipboard operation
asynquence copied to clipboard

contrib: method to compose multiple reactive sequences

Open getify opened this issue 10 years ago • 4 comments

var stream1 = ASQ.react(..);

var stream2 = ASQ.react(..);

var stream3 = ASQ.react.????( stream1, stream2 );

getify avatar Jul 22 '15 22:07 getify

Reactive Sequence Composition

  • ASQ.react.all(..) (alias zip(..) as with RxJS): sends an event only when there's an event in the buffer from all observed streams
  • ASQ.react.allLatest(..): same as all(..), except buffer size of 1, so only keeps latest message from each stream
  • ASQ.react.latest(..) (alias combineLatest(..) as with RxJS): sends an event whenever any observed stream fires, but always includes the latest from all observed streams
  • ASQ.react.any(..) (alias merge(..) as with RxJS): merging/collating events from multiple streams into one stream (no buffering, no waiting)

Reactive Sequence Transform

  • ASQ.react.distinct(..): ignores all duplicate (simple, shallow comparison) event messages from a single stream
  • ASQ.react.distinctConsecutive(..) (alias distinctUntilChanged(..) as with RxJS): ignores only consecutive duplicate (simple, shallow comparison) event messages from a single stream
  • ASQ.react.filter(..): filter out event messages from a single stream

getify avatar Jul 23 '15 22:07 getify

Sampling might be missing. See withLatestFrom and sample in RxJS. Also mergeMap/switchMap/concatMap are all variants of the "asyncMap" type of composition.

staltz avatar Sep 20 '15 17:09 staltz

What is this issue about? Something that should be added?

legodude17 avatar Jul 30 '16 20:07 legodude17

This is an ongoing tracking issue about me adding more reactive-sequences support. some of the code has been released, but i have an an outstanding set of work to rearrange it that has not yet been pushed.

getify avatar Jul 30 '16 21:07 getify