Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dataflow

  • 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.

Roadmap

  • Tests
  • Benchmarks
  • Documentation
  • Support redefinition of functions?
  • Add back helpers for DOM binding? (Skipped for now, to focus on core functionality.)

Installation

Use your package manager of choice:

npm install @joakimstai/dataflow
pnpm add @joakimstai/dataflow

Usage

Importing

Import using the appropriate method for your environment:

import { Dataflow } from '@joakimstai/dataflow'
const { Dataflow } = require('@joakimstai/dataflow')

Create a dataflow

const dataflow = new Dataflow()

Alternatively, define functions up front:

const dataflow = new Dataflow({ out: (x, y) => x + y })

Define functions

dataflow.define({ out: (x, y) => x + y })

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 }

About

A small reactive dataflow library for scheduling a DAG of async functions.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages