INNER CODE UNIT · JavaScript
processKey
zulip/zulip-mobile · src/redux-persist-migrate/index.js:8
const processKey = key => {
const int = parseInt(key, 10);
if (Number.isNaN(int)) {
throw new Error('redux-persist-migrate: migrations must be keyed with integer values');
}
return int;
};
/* eslint-disable no-use-before-define */
type PartialState = $ReadOnly<$Rest<State, { ... }>>;
export default function createMigration(
manifest: {| [string]: (PartialState) => PartialState |},
reducerKey: string,
): StoreEnhancer<State, Action, Dispatch<Action>> {
const migratePayload = createMigrationFunction(manifest, reducerKey);