From 18da9f3a4a52afe9d524038e61c08bb99b5c785d Mon Sep 17 00:00:00 2001 From: Nik Date: Thu, 11 Jul 2024 18:45:42 +0200 Subject: [PATCH] Synchronized linting in README.md (#358) --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8f693fc..0b48d5b 100644 --- a/README.md +++ b/README.md @@ -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. ``` @@ -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 }