-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reducerPath to extractRehydrationInfo #1645
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8d1996f:
|
size-limit report 📦
|
packages/toolkit/src/query/core/buildMiddleware/cacheCollection.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Lenz Weber <mail@lenzw.de>
((() => {}) as (a: AnyAction) => undefined) | ||
const extractRehydrationInfo = defaultMemoize((action: AnyAction) => | ||
options.extractRehydrationInfo?.(action, { | ||
reducerPath: (options.reducerPath ?? 'api') as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be done with:
type ReducerPathFromCreateApiOptions<
Options extends CreateApiOptions<any, any, any, any>
> = Options extends CreateApiOptions<any, any, infer RP, any> ? RP : unknown
reducerPath: (options.reducerPath ?? 'api') as ReducerPathFromCreateApiOptions<typeof options>,
But I don't think there is any need to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's reaaaally not do that ^^
In favor of #1643