-
-
Couldn't load subscription status.
- Fork 1.2k
Closed
Milestone
Description
Looks like we currently always dispatch inside of updateQueryData, even if there are no patches to apply:
if ('data' in currentState) {
if (isDraftable(currentState.data)) {
const [, patches, inversePatches] = produceWithPatches(
currentState.data,
updateRecipe
)
ret.patches.push(...patches)
ret.inversePatches.push(...inversePatches)
} else {
const value = updateRecipe(currentState.data)
ret.patches.push({ op: 'replace', path: [], value })
ret.inversePatches.push({
op: 'replace',
path: [],
value: currentState.data,
})
}
}
dispatch(api.util.patchQueryData(endpointName, args, ret.patches))We should bail out if patches.length === 0.
phryneas
Metadata
Metadata
Assignees
Labels
No labels