umc

url and middleware based state processor =================================

Usage no npm install needed!

<script type="module">
  import umc from 'https://cdn.skypack.dev/umc';
</script>

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