docs/js/remove.md
redux-sagaWe don't recommend removing redux-saga, as we strongly feel that it's the
way to go for most redux based applications.
If you really want to get rid of it, you will have to remove its presence from several places.
app/configureStore.js
import createSagaMiddleware from 'redux-saga'.const sagaMiddleware = createSagaMiddleware().sagaMiddleware from middlewares array.store.runSaga = sagaMiddleware.runstore.injectedSagas = {}; // Saga registryapp/tests/store.test.js
injectSagasrunSagaapp/utils
injectSaga.js, sagaInjectors.js, and constants.js.app/utils/checkStore.js
runSaga: isFunction,injectedSagas: isObject,app/utils/tests
injectSaga.test.js and sagaInjectors.test.jsapp/utils/tests/checkStore.test.js
expect(() => checkStore({ ...store, injectedSagas: null })).toThrow();expect(() => checkStore({ ...store, runSaga: null })).toThrow();app/containers/*/index.js
Clean up containers that inject a dynamic saga
const withSaga = injectSaga({ key: 'home', saga });.Finally, remove it from the package.json. Then you should be good to go with whatever
side-effect management library you want to use!
redux-saga from dependencieseslint-plugin-redux-saga from devDependencieseslintConfig > plugins > redux-sagaeslintConfig > rules > redux-saga/*reselectTo remove reselect, remove it from your dependencies in package.json and then write
your mapStateToProps functions like you normally would!
You'll also need to hook up the history directly to the store. Make changes to app/app.js.
import { makeSelectLocationState } from 'containers/App/selectors'history as follows:const makeSelectLocationState = () => {
let prevRoutingState;
let prevRoutingStateJS;
return state => {
const routingState = state.get('router'); // or state.route
if (!routingState.equals(prevRoutingState)) {
prevRoutingState = routingState;
prevRoutingStateJS = routingState.toJS();
}
return prevRoutingStateJS;
};
};
const history = syncHistoryWithStore(browserHistory, store, {
selectLocationState: makeSelectLocationState(),
});