-
Notifications
You must be signed in to change notification settings - Fork 1
Demuxer
Dan Stocker edited this page May 30, 2019
·
1 revision
Usage: createDemuxer<T>(fields: Array<keyof T>)
Module: flowcode-mux
Type: Demuxer<T>
Input ports:
-
d_mux:{field: keyof T; value: T[keyof T];}
Output ports: T (user defined)
De-multiplexes input value. Forwards input values from a single input port, demultiplexed, to multiple output ports.
import {connect} from "flowcode";
import {createDemuxer} from "flowcode-mux";
const demuxer = createDemuxer(["foo", "bar"]);
connect(demuxer.o.foo, console.log);
demuxer.i.d_mux({field: "foo", value: "a"}); // logs: "a"