@joakimstai/dataflow
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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 }

Package Sidebar

Install

npm i @joakimstai/dataflow

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

23.1 kB

Total Files

5

Last publish

Collaborators

  • joakimstai