Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "transforms/subchain"

Index

Functions

Functions

subchain

  • subchain<S, T>(f: function): Transform<S, T>
  • Returns a Transform that applies f to the observable.

    example

    subchain() can be used to create logical groups in a longer chain or to make parts of a chain reusable.

    ows
      .fromEvent(button, "click")
      .pipeThrough(
        ows.subchain(o =>
          o
            .pipeThrough(ows.map(() => fetch("/stockData")))
            .pipeThrough(ows.map(r => r.json()))
            .pipeThrough(ows.filter(data => data.tags.contains(importTag)))
        )
      )
      .pipeTo(
        ows.discard(data => {
          // ...
        })
      );

    Type parameters

    • S

      Type of items emitted by the original observable.

    • T

      Type of items returned by the observable f returns.

    Parameters

    Returns Transform<S, T>

    Transform that applies f to the observable.

Generated using TypeDoc