2 ms·
Nice! Seems more "raw context" than most of the simple state management libraries I've seen so far! I also created a library for state management including Con
by franciscop 6y ago
Nice! Seems more "raw context" than most of the simple state management libraries I've seen so far!
I also created a library for state management including Context, the main goal as well was not to rerender everything when a fragment of a Context changes (which is IMHO the main limitation of using Context):
https://statux.dev/ https://statux.dev/
const Counter = () => {
const [counter, setCounter] = useStore('counter');
const onClick = () => setCounter(counter + 1);
return <button onClick={onClick}>{counter}</button>;
}
// ...
const App = () => (
<Store counter={0}>
// ... App
</Store>
);
There's probably dozens like ours! It's fun, simplifies and improves development and it's not so heavy-handed as Redux (+ all the concepts behind).