0.1.0-rc.0 • Published 8 months ago

satyr v0.1.0-rc.0

Weekly downloads
8
License
MIT
Repository
github
Last release
8 months ago

satyr

A tiny observable store utility. A versino of vyce, but using getter/setter properties.

import { store, computed } from 'satyr';

const count = store(0);

// retrieve value by accessing `.value` property
console.log(count.value); // 0

// set the store value using assignment `=`
count.value = 10;
count.value += 1;

console.log(count.value); // 11

// subscribe to stores
count.sub(v => console.log(`Current count: ${v}`)); // logs `Current count: 11`

// create computed stores
const derived = computed(() => count.value * 100);
console.log(derived.value); // 1100
0.1.0-rc.0

8 months ago

0.0.88

4 years ago

0.0.1

5 years ago