vir-line
v2.0.1
Published
An assembly line / pipeline.
Maintainers
Readme
vir-line
An assembly line or pipeline that automatically aggregates each of its stages into a final state object type and supports scoped state listeners.
Usage
Here's a simple example that defines a stage, constructs and then starts a VirLine instance. See the TypeScript types for further options.
Each stage is intended to directly mutate the state object that it is given.
import {VirLine, VirLineStage} from 'vir-line';
const countStage = new VirLineStage<{count: number}>(
{
name: 'counter',
},
({state}) => {
state.count++;
},
);
const virLine = new VirLine(
[
countStage,
],
{
count: 0,
},
);
virLine.startUpdateLoop();