RE:DOM state handling example
https://pakastin.github.io/redom-state/
The whole redux-like state handling code is only 447 bytes uncompressed. Redux is 30.1 KB for comparison.
It uses native HTML events to dispatch actions upstream and RE:DOM component updates to update views downstream. That's it :)
Here's the action definitions: https://github.com/pakastin/redom-state/blob/master/js/actions.js
This is what binds everything together: https://github.com/pakastin/redom-state/blob/master/js/utils/api.js
- Fast
- Small
- Asynchronous, but immediate
- Flexible (stopPropagation etc)
I will release this as a separate library or some parts included in RE:DOM. For now it's just an experiment.
npm start
Then navigate to http://localhost:8080/
npm run dev