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: createMapper<I, O>(cb: (value: I, tag?: Tag) => O)
createMapper<I, O>(cb: (value: I, tag?: Tag) => O)
Module: flowcode-fp
Type: Mapper<I, O>
Mapper<I, O>
Input ports:
d_val
I
Output ports:
b_d_val
O
ev_err
string
Maps input value according to mapper callback. Bounces input, and emits stringified error when callback throws.
import {connect} from "flowcode"; import {createMapper} from "flowcode-fp"; const mapper = createMapper(next => 2 * next); connect(mapper.o.d_val, console.log); mapper.i.d_val(5); // logs: 10