mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
fix: return type of persist migrate function changed to PersistedState (#2360)
Co-authored-by: Bob Deprez <bob.deprez@zf.com>
This commit is contained in:
parent
1392c51fae
commit
9cb1c67827
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user