MCPcopy Index your code
hub / github.com/plotly/dash / reloaderReducer

Function reloaderReducer

dash/dash-renderer/src/reducers/reducer.js:148–162  ·  view source on GitHub ↗
(reducer)

Source from the content-addressed store, hash-verified

146}
147
148function reloaderReducer(reducer) {
149 return function (state, action) {
150 const {history, config, hooks} = state || {};
151 let newState = state;
152 if (action.type === 'RELOAD') {
153 newState = {history, config, hooks};
154 } else if (action.type === 'SET_CONFIG') {
155 // new config also reloads, and even clears history,
156 // in case there's a new user or even a totally different app!
157 // hooks are set at an even higher level than config though.
158 newState = {hooks};
159 }
160 return reducer(newState, action);
161 };
162}
163
164export function createReducer() {
165 return reloaderReducer(recordHistory(mainReducer()));

Callers 1

createReducerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…