- Efficient async dataflow
- Simple API
- 4 KB minified (1.5 KB gzipped)
- No dependencies
Based on tiny-reactive-dataflow, which was inspired by topologica. For now, see tiny-reactive-dataflow for a thorough explanation on how it works.
- Tests
- Benchmarks
- Documentation
- Support redefinition of functions?
- Add back helpers for DOM binding? (Skipped for now, to focus on core functionality.)
Use your package manager of choice:
npm install @joakimstai/dataflowpnpm add @joakimstai/dataflowImport using the appropriate method for your environment:
import { Dataflow } from '@joakimstai/dataflow'const { Dataflow } = require('@joakimstai/dataflow')const dataflow = new Dataflow()Alternatively, define functions up front:
const dataflow = new Dataflow({ out: (x, y) => x + y })dataflow.define({ out: (x, y) => x + y })await dataflow.set({ x: 1, y: 2 })await dataflow.get('out') // 3To access all resulting values:
dataflow.values // { x: 1, y: 2, out: 3 }