reactotron-redux
Version:
A Reactotron plugin for Redux.
14 lines (13 loc) • 527 B
JavaScript
;
export const DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE";
export default function reactotronReducer(
// eslint-disable-next-line @typescript-eslint/ban-types
rootReducer, actionName = DEFAULT_REPLACER_TYPE) {
// return this reducer
return (state, action) => {
// is this action the one we're waiting for? if so, use the state it passed
const whichState = action.type === actionName ? action.state : state;
return rootReducer(whichState, action);
};
}
//# sourceMappingURL=reducer.js.map