Closed ghost closed 8 years ago
Ahh sorry I wasn't checking the right action. It works with generator functions.
Here's how I did it:
import immutableStateInvariant from 'redux-immutable-state-invariant';
// add the middlewares
let middlewares = [];
// add the immutable dev middleware
if (process.env.NODE_ENV !== 'production') {
middlewares.push(immutableStateInvariant());
}
// add the router middleware
middlewares.push(routerMiddleware(browserHistory));
// add the saga middleware
const sagaMiddleware = createSagaMiddleware();
middlewares.push(sagaMiddleware);
// apply the middleware
let middleware = applyMiddleware(...middlewares);
// add the redux dev tools
if (process.env.NODE_ENV !== 'production' && window.devToolsExtension) {
middleware = compose(middleware, window.devToolsExtension());
}
// create the store
const store = createStore(reducers, middleware);
const history = syncHistoryWithStore(browserHistory, store);
sagaMiddleware.run(sagas);
So far redux-immutable-state-invariant gives warnings in the react components and in the reducers. but i'm not getting any errors from the sagas. Is there a plan for making this library work with generator functions needed for redux-saga?