Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

subchain

import { subchain } from "https://raw.githubusercontent.com/surma/observables-with-streams/28c55be6d855780c677fd1f4ba975f4d3144891d/src/index.ts";

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 => {
      // ...
    })
  );
function subchain<S, T>(f: (x: Observable<S>) => Observable<T>): Transform<S, T>;
§
subchain<S, T>(f: (x: Observable<S>) => Observable<T>): Transform<S, T>
[src]

§Type Parameters

§Parameters

§
f: (x: Observable<S>) => Observable<T>
[src]

Function that will be applied to the observable.

§Return Type

§

Transform that applies f to the observable.