UNPKG

react-sweet-state

Version:

Global + local state combining the best of Redux and Context API

6 lines (4 loc) 259 B
import defaults from '../defaults'; import update from './update'; const applyMiddleware = (storeState, middlewares) => Array.from(middlewares).concat(update).reduceRight((next, mw) => mw(storeState)(next), defaults.mutator); export default applyMiddleware;