File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/toolkit/src/query/core Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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 ) ,
You can’t perform that action at this time.
0 commit comments