mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
fix: Add deprecation notice for getServerState() in WithReact type (#2266)
This commit is contained in:
parent
740033cf31
commit
43a2b11ad9
@ -23,6 +23,7 @@ type ExtractState<S> = S extends { getState: () => infer T } ? T : never
|
||||
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'>
|
||||
|
||||
type WithReact<S extends ReadonlyStoreApi<unknown>> = S & {
|
||||
/** @deprecated please use api.getState() */
|
||||
getServerState?: () => ExtractState<S>
|
||||
}
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ type ExtractState<S> = S extends { getState: () => infer T } ? T : never
|
||||
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'>
|
||||
|
||||
type WithReact<S extends ReadonlyStoreApi<unknown>> = S & {
|
||||
/** @deprecated please use api.getState() */
|
||||
getServerState?: () => ExtractState<S>
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user