Chain functions together. First argument is the source. Use runN if you want to chain more links than is possible here, at the cost of poorer type hinting.
integers, and then filtering only even numbers.
const ch = Chains.run( [ `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` ], Chains.transform(v => Number.parseInt(v)), Chains.filter(v => v % 2 === 0));const output = await Async.toArray(ch2);// [ 2, 4, 6, 8, 10 ] Copy
const ch = Chains.run( [ `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` ], Chains.transform(v => Number.parseInt(v)), Chains.filter(v => v % 2 === 0));const output = await Async.toArray(ch2);// [ 2, 4, 6, 8, 10 ]
const c1 = Chains.run( Chains.fromEvent(window, `pointermove`), Chains.Links.transform(event => ({ x: event.x, y: event.y })));// Eg: print out data as it comes inIterables.forEach(c1, coord => { console.log(coord);});// Execution continues immediately Copy
const c1 = Chains.run( Chains.fromEvent(window, `pointermove`), Chains.Links.transform(event => ({ x: event.x, y: event.y })));// Eg: print out data as it comes inIterables.forEach(c1, coord => { console.log(coord);});// Execution continues immediately
Chain functions together. First argument is the source. Use runN if you want to chain more links than is possible here, at the cost of poorer type hinting.
Example: Process an array of strings. Transforming into
integers, and then filtering only even numbers.
Example: Grab the x/y coordinate from pointermove
Param: gen
Param: l0
Param: l1
Param: l2
Param: l3
Returns