Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "subs/sidechain-toggle"

Index

Functions

Const sidechainToggle

  • Returns Subscription which filters values from input based on values received from side chain.

    remarks

    By default, the value read from the side chain is ignored (i.e. only their timing is used), however the predicate option can be used to only trigger for specific values/conditions. Every time the predicate fn returns true, the filter will be toggled on/off. Whilst switched off, no input values will be forwarded.

    example
    // use slower interval stream to toggle main stream on/off
    fromInterval(500)
      .subscribe(sidechainToggle(fromInterval(1000)))
      .subscribe(trace());
    // 0
    // 3
    // 4
    // 7
    // 8
    ...

    Type parameters

    • A

    • B

    Parameters

    Returns Subscription<A, A>

Generated using TypeDoc