minimal-reactive
v1.4.0
Published
Smallest possible implementation of reactive programming, effects and dependencies.
Downloads
36
Readme
Smallest possible implementation of reactive programming, effects and dependencies.
Examples
import { dep, effect } from 'minimal-reactive'
const a = dep(3)
const b = dep(4)
effect({ a, b }, ({ a, b }) => {
// a + b are unboxed here
const result = a + b
console.log(result)
return () => {
// dispose
}
}) // prints 7
// changing values
a.value = 2 // prints 6
b.value = 3 // prints 5
API
Credits
- everyday-types by stagas – Everyday utility types
- everyday-utils by stagas – Everyday utilities
Contributing
All contributions are welcome!
License
MIT © 2022 stagas