Skip to content

Commit 29ff761

Browse files
committed
Byte-shave endpoint assignments
1 parent 78d427e commit 29ff761

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/toolkit/src/query/core/module.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,11 @@ export const coreModule = ({
657657
string,
658658
CoreModule
659659
>
660-
anyApi.endpoints[endpointName] ??= {} as any
660+
const endpoint = (anyApi.endpoints[endpointName] ??= {} as any)
661+
661662
if (isQueryDefinition(definition)) {
662663
safeAssign(
663-
anyApi.endpoints[endpointName],
664+
endpoint,
664665
{
665666
name: endpointName,
666667
select: buildQuerySelector(endpointName, definition),
@@ -671,7 +672,7 @@ export const coreModule = ({
671672
}
672673
if (isMutationDefinition(definition)) {
673674
safeAssign(
674-
anyApi.endpoints[endpointName],
675+
endpoint,
675676
{
676677
name: endpointName,
677678
select: buildMutationSelector(),
@@ -682,7 +683,7 @@ export const coreModule = ({
682683
}
683684
if (isInfiniteQueryDefinition(definition)) {
684685
safeAssign(
685-
anyApi.endpoints[endpointName],
686+
endpoint,
686687
{
687688
name: endpointName,
688689
select: buildInfiniteQuerySelector(endpointName, definition),

0 commit comments

Comments
 (0)