Skip to content

Commit

Permalink
fix: Add deprecation notice for getServerState() in WithReact type
Browse files Browse the repository at this point in the history
  • Loading branch information
charkour committed Dec 21, 2023
1 parent a4578fa commit cd8bf45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
}

Expand Down
1 change: 1 addition & 0 deletions src/traditional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
}

Expand Down

0 comments on commit cd8bf45

Please sign in to comment.