Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronized linting in README.md #358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
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