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

initiate with {subscribe: false} resets keepUnusedDataFor #4480

Open
PepeBotella25 opened this issue Jun 24, 2024 · 0 comments
Open

initiate with {subscribe: false} resets keepUnusedDataFor #4480

PepeBotella25 opened this issue Jun 24, 2024 · 0 comments

Comments

@PepeBotella25
Copy link

PepeBotella25 commented Jun 24, 2024

Calling initiate with {subscribe: false} seems to be resetting keepUnusedDataFor and cached data never expires

// default keepUnusedDataFor is 60s

// Does the request and caches the data as expected
store.dispatch(api.endpoints.myEndpoint.initiate({}, { subscribe: false }))

// Does not trigger a request and uses cached data as expected
setTimeout(() => store.dispatch(api.endpoints.myEndpoint.initiate({}, { subscribe: false })), 30 * 1000);

// Does not trigger a request and uses cached data which should be expired
setTimeout(() => store.dispatch(api.endpoints.myEndpoint.initiate({}, { subscribe: false })), 61 * 1000);
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

No branches or pull requests

1 participant