INNER CODE UNIT · JavaScript
migrationDispatch
zulip/zulip-mobile · src/redux-persist-migrate/index.js:26
const migrationDispatch = next => (action: Action) => {
if (action.type === REHYDRATE) {
return next({ ...action, payload: migratePayload(action.payload) });
}
return next(action);
};
return next => (reducer, initialState) => {
const store = next(reducer, initialState);
return {
...store,
dispatch: migrationDispatch(store.dispatch),
};
};
}
/** Exported only for tests. */
export function createMigrationFunction(