redux-toolkit
redux-toolkit copied to clipboard
feat(query): Adds subscribe option to prefetch, automatically unsubscribes if not present [#1283]
References: https://github.com/reduxjs/redux-toolkit/issues/1283
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 81d929a880020c922e34af4435bf47d64b5b11e6:
| Sandbox | Source |
|---|---|
| Vanilla | Configuration |
| Vanilla Typescript | Configuration |
| rsk-github-issues-example | Configuration |
| @examples-query-react/basic | Configuration |
| @examples-query-react/advanced | Configuration |
| @examples-action-listener/counter | Configuration |
I would keep the "automatic unsubscribe" out of this PR in general and keep the scope of this to only adding a subscribe yes/no option.
The rest should be done in a separate PR handling #1282 that would automatically subscribe all queries but automatically unsubscribe them after the thunk has resolved if subscribe: false.