We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Usage: createFilter<V>(cb: (value: V, tag?: Tag) => boolean)
createFilter<V>(cb: (value: V, tag?: Tag) => boolean)
Module: flowcode-fp
Type: Filter<V>
Filter<V>
Input ports:
d_val
V
Output ports:
b_d_val
ev_err
string
Filters input values according to a filter callback. Bounces input, and emits stringified error when callback throws.
import {connect} from "flowcode"; import {createFilter} from "flowcode-fp"; const filter = createFilter(next => next > 5); connect(filter.o.d_val, console.log); filter.i.d_val(3); // doesn't log filter.i.d_val(5); // doesn't log filter.i.d_val(8); // logs: 8