redux-zero
Advanced tools
Changelog
4.6.0
// a middleware
const logger = store => next => action => {
console.log("current state", store.getState());
return next(action);
};
// compose middlewares
const middlewares = applyMiddleware(logger, anotherMiddleware);
const store = createStore({}, middlewares);
Changelog
4.5.2
Changelog
4.5.0
const mapActions = ({ setState }) => ({
getTodos() {
setState({ loading: true });
return client
.get("/todos")
.then(payload => ({ payload, loading: false }))
.catch(error => ({ error, loading: false }));
}
});
Changelog
4.4.2
[info] Using redux-zero along with TypeScript gives an error when implementing:
<Provider store={store}><Whatever/></Provider>
due to the actual store object
and the expected attribute differ.
Changelog
4.4.1