Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Siggie

A small reactive runtime for JavaScript.

npm install siggie
import { computed, effect, signal } from "siggie";

const price = signal(10);
const quantity = signal(2);
const total = computed(() => price.value * quantity.value);

effect(() => {
  console.log(total.value);
}, true);

price.value = 12;
quantity.value = 3;

API

  • signal(value) creates a writable signal.
  • computed(fn) creates a lazy computed signal.
  • effect(fn, sync?, scope?) creates an effect and returns its disposer.
  • batch(fn) groups writes and coalesces synchronous effects.
  • flushSync() drains queued effects.
  • Read .peek without creating a dependency.
  • Assign .eq to customize equality.

Development

npm test
npm run bench

Benchmark results are in benchmarks/README.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages