From 9cb1c67827f080576c7e774ee995af245a5e4afa Mon Sep 17 00:00:00 2001 From: bobdepreziz <61680681+bobdepreziz@users.noreply.github.com> Date: Sat, 2 Mar 2024 03:16:00 +0100 Subject: [PATCH] fix: return type of persist migrate function changed to PersistedState (#2360) Co-authored-by: Bob Deprez --- src/middleware/persist.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/middleware/persist.ts b/src/middleware/persist.ts index b56f531cde..fc8650034e 100644 --- a/src/middleware/persist.ts +++ b/src/middleware/persist.ts @@ -126,7 +126,10 @@ export interface PersistOptions { * 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 + migrate?: ( + persistedState: unknown, + version: number, + ) => PersistedState | Promise /** * A function to perform custom hydration merges when combining the stored state with the current one. * By default, this function does a shallow merge.