Skip to content

Commit 9cb1c67

Browse files
bobdeprezizBob Deprez
and
Bob Deprez
authored
fix: return type of persist migrate function changed to PersistedState (#2360)
Co-authored-by: Bob Deprez <[email protected]>
1 parent 1392c51 commit 9cb1c67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/middleware/persist.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ export interface PersistOptions<S, PersistedState = S> {
126126
* A function to perform persisted state migration.
127127
* This function will be called when persisted state versions mismatch with the one specified here.
128128
*/
129-
migrate?: (persistedState: unknown, version: number) => S | Promise<S>
129+
migrate?: (
130+
persistedState: unknown,
131+
version: number,
132+
) => PersistedState | Promise<PersistedState>
130133
/**
131134
* A function to perform custom hydration merges when combining the stored state with the current one.
132135
* By default, this function does a shallow merge.

0 commit comments

Comments
 (0)