umc

0.5.6 • Public • Published

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

Package Sidebar

Install

npm i umc

Weekly Downloads

6

Version

0.5.6

License

MIT

Last publish

Collaborators

  • kiliwalk