Comparing version 5.0.1 to 5.0.2
@@ -362,9 +362,10 @@ 'use strict'; | ||
if (options.migrate) { | ||
return [ | ||
true, | ||
options.migrate( | ||
deserializedStorageValue.state, | ||
deserializedStorageValue.version | ||
) | ||
]; | ||
const migration = options.migrate( | ||
deserializedStorageValue.state, | ||
deserializedStorageValue.version | ||
); | ||
if (migration instanceof Promise) { | ||
return migration.then((result) => [true, result]); | ||
} | ||
return [true, migration]; | ||
} | ||
@@ -371,0 +372,0 @@ console.error( |
@@ -47,3 +47,3 @@ import type { StateCreator, StoreApi, StoreMutatorIdentifier } from '../vanilla'; | ||
} | ||
type Devtools = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [...Mps, ['zustand/devtools', never]], Mcs>, devtoolsOptions?: DevtoolsOptions) => StateCreator<T, Mps, [['zustand/devtools', never], ...Mcs]>; | ||
type Devtools = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = [], U = T>(initializer: StateCreator<T, [...Mps, ['zustand/devtools', never]], Mcs, U>, devtoolsOptions?: DevtoolsOptions) => StateCreator<T, Mps, [['zustand/devtools', never], ...Mcs]>; | ||
declare module '../vanilla' { | ||
@@ -50,0 +50,0 @@ interface StoreMutators<S, A> { |
@@ -6,3 +6,3 @@ { | ||
"type": "commonjs", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"main": "./index.js", | ||
@@ -9,0 +9,0 @@ "types": "./index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88793
1480