State Management · Senior · Question 63 of 75
What does SWR's custom cache provider option allow?
- ✓Correct answer: Replacing the default in-memory Map, e.g. to persist the cache to
localStorageor isolate caches in tests - 2Fetching data from multiple servers
- 3Encrypting requests
Explanation
Wrap tests in <SWRConfig value={{ provider: () => new Map() }}> so each test starts with an empty cache.