0

We currently have such values set in a settings slice;

settingsSlice: {
  projectId: 'a'
}

The projectId in the example above is used to compose a dynamic URL that an RTK Query API uses for requests, e.g. https://projectId...

Is it possible to invalidate the API data upon a change to the settings slice?

From the documentation, it seems possible to invalidate other API's using tags, but that doesn't seem to be supported within state slices.

KwehDev
  • 261
  • 1
  • 3
  • 14

1 Answers1

2

No you would have to manually call dispatch(api.invalidateTags(...)).

phry
  • 35,762
  • 5
  • 67
  • 81