umc
v0.5.6
Published
url and middleware based state processor
Downloads
13
Maintainers
Readme
url and middleware based state processor
Combine the express/koa/ums and flux/redux to make a flexible javascript state container.
See umc-managed-store
for a more safety and robust store.
const store = umc(initialState);
store.use((req, resp, next)=>{
if(req.url === '/action'){
console.log(req.body);
let newState = {...};
return resp.send(newState);
}
})
store.subscribe((state)=>{
console.log(state);
})
//...
store.dispatch('/action', params);
License
Licensed under MIT
Copyright (c) 2016 kiliwalk