Redux middleware for intuitively mapping urls to state
npm install --save reducerless-redux
The following ES6 functions are required:
Check the compatibility tables (
fetch) to make sure all browsers and platforms you need to support have these, and include polyfills as necessary.
This project was inspired by React-Refetch. I like the intuitive way that react-refetch maps url's to props, but I found myself wanting at the same time to leverage redux and react-redux connect's easy way of spreading data around nested heirarchies of components. The thing that turns me off about redux, however, is the proliferation of reducers. They always felt cumbersome, especially since the vast majority of the time all I want to is modify a particular piece of state. To that end I've created a redux middleware and store enhancer that maps url's to state, using a single "invisible" reducer. I also like the PromiseState that react-refetch uses, so all actions result in PromiseStates. The state to props mapping can be done by react-redux connect, which already does a great job at that. I thought about wrapping connect with something that would give you automatic fetching and refetching, but decided against it because the same thing can be achieved with
... read the whole story at github.com.