Skip to content

MigrationMap

MigrationMap<TState> = Record<number, (persistedState) => Partial<TState>>

Defined in: types.ts:57

A migration step that transforms persisted state from one version to the next.

Migrations run in order from the persisted version up to the current version. Each migration must return state shaped for its target version.

TState

const migrations: MigrationMap<UserState> = {
2: (oldState) => ({ ...oldState, prefs: oldState.preferences }),
};