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 authored Jan 20, 2024
1 parent 740033c commit 43a2b11
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

1 comment on commit 43a2b11

@vercel
Copy link

@vercel vercel bot commented on 43a2b11 Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.