xoid
xoid copied to clipboard
Framework-agnostic state management library designed for simplicity and scalability ⚛
## Overview It's odd to me that (computed) Atoms like `atom(read => read($count) * 2)` still have `.set` and `.update` methods. As a "consumer" of the above Atom (without knowledge...
### Added - `.get` method to atoms - The new middleware API that's accesed via `atom.call` or `atom.bind`. ### Deprecated - State getter's additional overload for consuming external sources is...
This one may be a little controversial, and I respect that you might have thought of this and ultimately preferred only having the `.value` getter. I personally prefer `.get()` as...
```javascript // From https://www.xoid.dev/docs/performance-optimizations const $atom = create(() => { console.log('I am lazily evaluated!') return expensiveComputation(25) }) ``` ```javascript // Is it okay this way? const $atom = create(async ()...
I can never remember which is which between `subscribe()` and `watch()`. One of them calls the callback with the current value at the start, but the other doesn't. Could we...