@joakimstai/dataflow
v0.1.0
Published
A tiny reactive dataflow library for scheduling a DAG of async functions.
Downloads
4
Maintainers
Readme
Dataflow
Based on tiny-reactive-dataflow, which was inspired by topologica. For now, see tiny-reactive-dataflow for a thorough explanation on how it works.
This is a work in progress. Roadmap:
- [ ] Tests
- [ ] Benchmarks
- [ ] Documentation file
- [ ] Support redefinition of functions?
Examples
Create dataflow
const dataflow = new Dataflow({ out: (x, y) => x + y })
const dataflow = new Dataflow()
dataflow.define({ out: (x, y) => x + y })
define
is the same as register
in tiny-reactive-dataflow.
Set values
await dataflow.set({ x: 1, y: 2 });
Get values
await dataflow.get('out') // 3
To access all resulting values:
dataflow.values // { x: 1, y: 2, out: 3 }