https://github.com/c-ehrlich/broadcast-invalidation-demo
https://github.com/c-ehrlich/broadcast-invalidation-demo
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/c-ehrlich/broadcast-invalidation-demo
- Owner: c-ehrlich
- Created: 2024-05-28T07:51:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T16:31:06.000Z (about 2 years ago)
- Last Synced: 2025-03-24T14:51:41.244Z (over 1 year ago)
- Language: TypeScript
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Instructions to replicate
## Current state
- `cd ./before`, `pnpm i`, `pnpm dev`
- open two windows of `localhost:5173` and open RQ devtools
- invalidation across tabs will work
- hide the query in one tab, see in devtools that the query is removed in both tabs - invalidation across tabs no longer works
- show the query again, invalidation across tabs will still be broken even though the query has an observer in both tabs again
## My (bad) fix
- `cd ./after`, `pnpm i`, `pnpm dev`
- same as above, but the query will now no longer be removed from the tab that needs it, and invalidation will continue to work across tabs
- see diff: https://github.com/c-ehrlich/broadcast-invalidation-demo/commit/e2133b9bb01876d31d9b259933b212002becd705 (the initial version of broadcast-query-client is just copy pasted from `@tanstack/query-broadcast-client-experimental@5.38.0`)