React Boilerplate Redux Saga Hoc

Search Results

No results for 'N/A'
1. Getting Started
2. Basic Concepts
3. Handlers
4. Advanced Concepts
4.0.1 Creating Custom Reducer4.0.2 Modifying api end points reducer constants4.0.3 Don't reset on setting to initial state4.0.4 Cancelling Api Calls4.0.5 Axios Interceptors4.0.6 Inject saga and reducer to the store# Inject saga and reducer to the store4.0.7 Inject saga and reducer to the store by using hooks4.0.8 Util Functions4.0.9 PARAMS4.1.0 Handling Multiple tasks
5. Examples6. Advanced Examples7. ParamsApi ReferenceComplete DocumentationPrevious DocumentationReadme

# Inject saga and reducer to the store

Note:
- By injecting reducer and saga you can able to create your own reducer and saga.
- It helps in most of the scenarios such as polling,creating youer own logic ..etc
import { takeLatest } from "redux-saga/effects";
import { injectReducer, injectSaga } from "react-boilerplate-redux-saga-hoc";
const initialState = {};
const reducer = (state = initialState, action) => {
return state;
};
function* getRepos() {}
const saga = function*() {
yield takeLatest("LOAD_DATA", getRepos);
};
const withSaga = injectSaga({ key: "dashboard", saga });
const withReducer = injectReducer({ key: "dashboard", reducer });
export default compose(withSaga, withReducer)(Dashboard);