File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 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.
266266
267267``` js
268268// Request begins...
269- const userLoader = new DataLoader (... )
269+ const userLoader = new DataLoader (... );
270270
271271// And a value happens to be loaded (and cached).
272- const user = await userLoader .load (4 )
272+ const user = await userLoader .load (4 );
273273
274274// 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 );
277277
278278// 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 );
280280
281281// Request completes.
282282```
@@ -292,10 +292,10 @@ In some circumstances you may wish to clear the cache for these individual Error
292292
293293``` js
294294try {
295- const user = await userLoader .load (1 )
295+ const user = await userLoader .load (1 );
296296} catch (error) {
297297 if (/* determine if the error should not be cached */ ) {
298- userLoader .clear (1 )
298+ userLoader .clear (1 );
299299 }
300300 throw error
301301}
You can’t perform that action at this time.
0 commit comments