Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup polls on unsubscribeQueryResult #1933

Merged
merged 3 commits into from
Jan 22, 2022
Merged

Cleanup polls on unsubscribeQueryResult #1933

merged 3 commits into from
Jan 22, 2022

Conversation

msutkowski
Copy link
Member

@msutkowski msutkowski commented Jan 17, 2022

Bugfix: clears polls when the last component for a queryCacheKey unsubscribes.

@github-actions
Copy link

github-actions bot commented Jan 17, 2022

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit (cjs.production.min.js) 12.93 KB (0%)
1. entry point: @reduxjs/toolkit (esm.js) 10.79 KB (0%)
1. entry point: @reduxjs/toolkit/query (cjs.production.min.js) 22.61 KB (+0.06% 🔺)
1. entry point: @reduxjs/toolkit/query (esm.js) 18.96 KB (+0.06% 🔺)
1. entry point: @reduxjs/toolkit/query/react (cjs.production.min.js) 24.86 KB (+0.05% 🔺)
1. entry point: @reduxjs/toolkit/query/react (esm.js) 21.65 KB (+0.06% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs.production.min.js) 5.71 KB (0%)
2. entry point: @reduxjs/toolkit (without dependencies) (esm.js) 5.67 KB (0%)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs.production.min.js) 10.07 KB (+0.1% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (esm.js) 10.49 KB (+0.12% 🔺)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (cjs.production.min.js) 2.8 KB (0%)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (esm.js) 3.21 KB (0%)
3. createSlice (esm.js) 5.03 KB (0%)
3. createEntityAdapter (esm.js) 6.28 KB (0%)
3. configureStore (esm.js) 5.65 KB (0%)
3. createApi (esm.js) 17.2 KB (+0.06% 🔺)
3. createApi (react) (esm.js) 19.92 KB (+0.06% 🔺)
3. fetchBaseQuery (esm.js) 11.61 KB (0%)
3. setupListeners (esm.js) 10.42 KB (0%)
3. ApiProvider (esm.js) 18.54 KB (+0.07% 🔺)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 17, 2022

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 ecdbb0e:

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

@dapperdandev
Copy link

This is an example of what I had locally for #1928. /cc @djbreen7

@msutkowski Awesome! Looks like I can close my PR then?

@@ -116,10 +117,15 @@ export const build: SubMiddlewareBuilder = ({
}
}

function cleanupPollForKey(key: string) {
const existingPoll = currentPolls[key]
existingPoll?.timeout && clearTimeout(existingPoll.timeout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use an if statement here for readability.

@msutkowski msutkowski merged commit 13ee4c5 into master Jan 22, 2022
@msutkowski msutkowski deleted the pr-1928-patch branch January 22, 2022 22:26
@phryneas
Copy link
Member

phryneas commented Feb 3, 2022

Released in https://github.com/reduxjs/redux-toolkit/releases/tag/v1.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants