Skip to content

Commit a4bce1a

Browse files
committed
docs: simplify README
1 parent 73171f6 commit a4bce1a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,18 @@ Integrate idb-cache as an AsyncStorage persister for TanStack Query.
7878

7979
```typescript
8080
import { QueryClient } from '@tanstack/query-core';
81-
import { experimental_createPersister } from '@tanstack/query-persist-client-core';
82-
import { IDBCache } from 'idb-cache';
83-
84-
const cacheBuster = 'my_salt'; // Doubles as salt for encryption
81+
import { experimental_createPersister as createPersister } from '@tanstack/query-persist-client-core';
82+
import { IDBCache } from '@instructure/idb-cache';
8583

8684
const idbCache = new IDBCache({
8785
cacheKey: 'user_cache_key',
88-
cacheBuster,
8986
});
9087

91-
// Create the persister
92-
const persister = experimental_createPersister({
88+
const persister = createPersister({
9389
storage: idbCache,
9490
maxAge: 1000 * 60 * 60 * 24 * 7, // 7 days
95-
buster: cacheBuster,
9691
});
9792

98-
// Initialize the QueryClient with the persister
9993
export const queryClient = new QueryClient({
10094
defaultOptions: {
10195
queries: {
@@ -105,6 +99,8 @@ export const queryClient = new QueryClient({
10599
},
106100
},
107101
});
102+
103+
108104
```
109105

110106
## Data flow

0 commit comments

Comments
 (0)