fix(types): remove Partial typo from persist (#1051)

* fix(types): remove `Parital` typo from `persist`

* migrate tests

* format
This commit is contained in:
Devansh Jethmalani 2022-07-17 04:36:31 +05:30 committed by GitHub
parent 62d1cab407
commit 81d7c4fa13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -303,7 +303,7 @@ type Persist = <
T extends State,
Mps extends [StoreMutatorIdentifier, unknown][] = [],
Mcs extends [StoreMutatorIdentifier, unknown][] = [],
U = Partial<T>
U = T
>(
initializer: StateCreator<T, [...Mps, ['zustand/persist', unknown]], Mcs>,
options?: PersistOptions<T, U>

View File

@ -394,6 +394,7 @@ describe('persist middleware with sync configuration', () => {
persist(() => ({ count: 0 }), {
name: 'test-storage',
getStorage: () => storage,
partialize: (s) => s as Partial<typeof s>,
})
)