Bookie
Predictable and scalable state container in 0.5kB.
Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better.
— Edsger W. Dijkstra, 1984
If Redux evolves the ideas from Flux but without it's complexity, Bookie
evolves the ideas from Redux, by reducing the complexity still.
Gist
import { createStore } from 'bookie';
const store = createStore(0);
const increment = store.createAction((state, payload = 1) => state + payload);
const decrement = store.createAction((state, payload = 1) => state - payload);
const unsubscribe = store.subscribe(console.log);
increment();
increment();
increment(5);
decrement();
unsubscribe();
decrement();
console.log('Final state', store.getState());