Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "subs/sidechain-partition"

Index

Functions

Const sidechainPartition

  • Returns a Subscription which buffers values from src until side chain fires, then emits buffer (unless empty) and repeats process until either input is done.

    remarks

    By default, the values read from the side chain are ignored (i.e. only their timing is used), however the predicate option can be used to only trigger for specific values / conditions.

    example
    // merge various event streams
    events = merge([
        fromEvent(document,"mousemove"),
        fromEvent(document,"mousedown"),
        fromEvent(document,"mouseup")
    ]);
    
    // queue event processing to only execute during the
    // requestAnimationFrame cycle (RAF)
    events.subscribe(sidechainPartition(fromRAF())).subscribe(trace())

    Type parameters

    • A

    • B

    Parameters

    Returns Subscription<A, A[]>

Generated using TypeDoc