1.4.0 • Published 1 year ago

minimal-reactive v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2022 stagas

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago