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:
bobdepreziz 2024-03-02 03:16:00 +01:00 committed by GitHub
parent 1392c51fae
commit 9cb1c67827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.