fix: Add deprecation notice for getServerState() in WithReact type (#2266)

This commit is contained in:
Charles Kornoelje 2024-01-19 19:37:19 -05:00 committed by GitHub
parent 740033cf31
commit 43a2b11ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ type ExtractState<S> = S extends { getState: () => infer T } ? T : never
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'> type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'>
type WithReact<S extends ReadonlyStoreApi<unknown>> = S & { type WithReact<S extends ReadonlyStoreApi<unknown>> = S & {
/** @deprecated please use api.getState() */
getServerState?: () => ExtractState<S> getServerState?: () => ExtractState<S>
} }

View File

@ -23,6 +23,7 @@ type ExtractState<S> = S extends { getState: () => infer T } ? T : never
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'> type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'subscribe'>
type WithReact<S extends ReadonlyStoreApi<unknown>> = S & { type WithReact<S extends ReadonlyStoreApi<unknown>> = S & {
/** @deprecated please use api.getState() */
getServerState?: () => ExtractState<S> getServerState?: () => ExtractState<S>
} }