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 => {
// ...
})
);
§
§Parameters
§
f: (x: Observable<S>) => Observable<T>
[src]Function that will be applied to the observable.