A 50-line simple implementation of Redux when learning Redux.
- basic state management:
- get state
- dispatch action
- specify reducer
- subscribe listener
- combine reducers
- using middlewares
subset of Redux's API
- createStore(reducer, enhancer)
- store.getState()
- store.dispatch(action)
- store.subscribe(listener)
- combineReducers(reducers)
- applyMiddleware(...middlewares)
Based on redux's counter-vanilla example, add combineReducers()
and applyMiddleware
. see: index.html