Kind of like Redux.
The goal of this experiment are:
- decouple the "subscribe" part of Redux from the reduce/dispatch
- shrink the API to just a few functions and reimplement a lot of the functionality as (optional) higher-order functions.
createStore
(src)
Takes a reducer
and backingStore
, returns { dispatch, getState }
Reducers are functions of (state, action)
and return a new state.
Backing stores must have a getState
and setState
method. See ./src/backing-stores
for some implementations.
- ✅ Implemented
- ❌ Unimplemented
✅ "Plain Ole Javascript Object" - basic implementation. Needs a lot of wrapping to be useful.
✅ Uses React Component state as the API.
✅ Implements the Callbag spec for observables.
✅ Wraps a reducer so it can return a partial state object, similar to the React setState
API.
✅ Wraps a reducer and store to comply with the Redux Devtools API to implement timetravel debugging
❌ Support async actions using an API like Promises or function dispatch (thunks).
All the goodies are in src/App.js
Run locally: yarn install && yarn start
- https://github.com/developit/unistore
- https://github.com/jamiebuilds/unstated
- https://github.com/reactjs/redux
- https://github.com/mobxjs/mobx
This project was bootstrapped with Create React App.