Skip to content

Commit 001d7a1

Browse files
GeorchWmarkerikson
authored andcommitted
Add minor optimization
1 parent 15511e3 commit 001d7a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/toolkit/src/query/core/buildMiddleware/invalidationByTags.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export const buildInvalidationByTagsHandler: InternalHandlerBuilder = ({
108108
const state = rootState[reducerPath]
109109

110110
const tags = [...state.pendingTagInvalidations, ...newTags]
111+
if (tags.length === 0) return
111112

112113
const toInvalidate = api.util.selectInvalidatedBy(rootState, tags)
113114

0 commit comments

Comments
 (0)