Search Results

No results for 'N/A'

# Don't reset on setting to initial state

import { HOC, commonConstants, store } from "react-boilerplate-redux-saga-hoc";
const TEST_API = {};
const REGISTER_API = {
url: `users/user-signup/`,
method: "POST",
};
const AuthenticationHOC = HOC({
initialState: {
profile: {},
},
dontReset: {
REGISTER_API,
},
apiEndPoints: {
TEST_API,
REGISTER_API,
},
constantReducer: ({
type,
state,
action,
constants,
initialState,
resetState,
}) => {
if (type === "LOGOUT") return resetState; // it will only reset TEST_API to initial state
return state;
},
name: "Auth",
});
/*
Example:
const { dispatch } = props;
dispatch({ type: 'LOGOUT' });
*/