Skip to content

Commit

Permalink
Synchronized linting in README.md (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
shevchenkonik authored Jul 11, 2024
1 parent 003c045 commit 18da9f3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,17 @@ Here's a simple example using SQL UPDATE to illustrate.

```js
// Request begins...
const userLoader = new DataLoader(...)
const userLoader = new DataLoader(...);

// And a value happens to be loaded (and cached).
const user = await userLoader.load(4)
const user = await userLoader.load(4);

// A mutation occurs, invalidating what might be in cache.
await sqlRun('UPDATE users WHERE id=4 SET username="zuck"')
userLoader.clear(4)
await sqlRun('UPDATE users WHERE id=4 SET username="zuck"');
userLoader.clear(4);

// Later the value load is loaded again so the mutated data appears.
const user = await userLoader.load(4)
const user = await userLoader.load(4);

// Request completes.
```
Expand All @@ -292,10 +292,10 @@ In some circumstances you may wish to clear the cache for these individual Error

```js
try {
const user = await userLoader.load(1)
const user = await userLoader.load(1);
} catch (error) {
if (/* determine if the error should not be cached */) {
userLoader.clear(1)
userLoader.clear(1);
}
throw error
}
Expand Down

0 comments on commit 18da9f3

Please sign in to comment.