This repository is primary used to demonstrate how a cache can be shared across multiple tabs/windows using the following mechanisms:
- Broadcast Channel (via broadcastQueryClient)
- SharedWorker (via persistQueryClient and a SharedWorker persister)
The code itself is largely borrowed from the TanStack Query repository, with some modifications to support the cache sharing.
To view the demo app in action, see: https://sjp.co.nz/projects/query-shared-worker-persister/demo
To run this example:
npm install
npm run dev