Skip to content

Commit

Permalink
fix: return type of persist migrate function changed to PersistedState (
Browse files Browse the repository at this point in the history
#2360)

Co-authored-by: Bob Deprez <bob.deprez@zf.com>
  • Loading branch information
bobdepreziz and Bob Deprez authored Mar 2, 2024
1 parent 1392c51 commit 9cb1c67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middleware/persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ export interface PersistOptions<S, PersistedState = S> {
* A function to perform persisted state migration.
* This function will be called when persisted state versions mismatch with the one specified here.
*/
migrate?: (persistedState: unknown, version: number) => S | Promise<S>
migrate?: (
persistedState: unknown,
version: number,
) => PersistedState | Promise<PersistedState>
/**
* A function to perform custom hydration merges when combining the stored state with the current one.
* By default, this function does a shallow merge.
Expand Down

0 comments on commit 9cb1c67

Please sign in to comment.