File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -266,17 +266,17 @@ Here's a simple example using SQL UPDATE to illustrate.
266
266
267
267
``` js
268
268
// Request begins...
269
- const userLoader = new DataLoader (... )
269
+ const userLoader = new DataLoader (... );
270
270
271
271
// And a value happens to be loaded (and cached).
272
- const user = await userLoader .load (4 )
272
+ const user = await userLoader .load (4 );
273
273
274
274
// A mutation occurs, invalidating what might be in cache.
275
- await sqlRun (' UPDATE users WHERE id=4 SET username="zuck"' )
276
- userLoader .clear (4 )
275
+ await sqlRun (' UPDATE users WHERE id=4 SET username="zuck"' );
276
+ userLoader .clear (4 );
277
277
278
278
// Later the value load is loaded again so the mutated data appears.
279
- const user = await userLoader .load (4 )
279
+ const user = await userLoader .load (4 );
280
280
281
281
// Request completes.
282
282
```
@@ -292,10 +292,10 @@ In some circumstances you may wish to clear the cache for these individual Error
292
292
293
293
``` js
294
294
try {
295
- const user = await userLoader .load (1 )
295
+ const user = await userLoader .load (1 );
296
296
} catch (error) {
297
297
if (/* determine if the error should not be cached */ ) {
298
- userLoader .clear (1 )
298
+ userLoader .clear (1 );
299
299
}
300
300
throw error
301
301
}
You can’t perform that action at this time.
0 commit comments