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 store4.0.7 Inject saga and reducer to the store by using hooks# 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 by using hooks

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 your own logic..etc
import { takeLatest } from "redux-saga/effects";
import {
useInjectReducer,
useInjectSaga,
} from "react-boilerplate-redux-saga-hoc";
const reducer = (state, action) => {
return state;
};
function* getRepos() {}
const saga = function*() {
yield takeLatest("LOAD_DATA", getRepos);
};
const key = "Dashboard";
const Dashboard = () => {
useInjectReducer({ key, reducer });
useInjectSaga({ key, saga });
return <div />;
};
export default Dashboard;