Skip to content

Commit

Permalink
📝 Expand getRunningOperationPromise description
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrugsy committed Oct 29, 2021
1 parent 55560b2 commit 0e7c9a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/rtk-query/api/created-api/api-slice-utils.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ getRunningOperationPromise: <EndpointName extends MutationKeys<Definitions>>(
A function that returns a single promise for a given endpoint name + argument combination,
if it is currently running. If it is not currently running, the function returns `undefined`.
When used with mutation endpoints, it accepts a [fixed cache key](./hooks.mdx#signature-1)
or request ID rather than the argument.
This is primarily added to add experimental support for suspense in the future.
It enables writing custom hooks that look up if RTK Query has already got a running promise
for a certain endpoint/argument combination, and retrieving that promise to `throw` it.

0 comments on commit 0e7c9a6

Please sign in to comment.