State Management · Middle · Question 75 of 75
How do you integrate a WebSocket price feed into SWR's cache?
- ✓Correct answer: With
useSWRSubscription, which subscribes to a source and pushes updates into the key's data - 2With
refreshInterval: 0 - 3WebSockets can't be used with SWR
Explanation
Subscriptions are deduplicated by key like normal requests, so several components share one socket subscription.