Skip to content

Commit 53300d3

Browse files
ashishmauryatargos
authored andcommitted
doc: fixed variable names in queueMicrotask example
fixed variable name in queueMicrotask where url variable was used instead of key PR-URL: #39634 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent dbaf498 commit 53300d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/api/globals.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ within each turn of the Node.js event loop.
242242
// before any other promise jobs.
243243

244244
DataHandler.prototype.load = async function load(key) {
245-
const hit = this._cache.get(url);
245+
const hit = this._cache.get(key);
246246
if (hit !== undefined) {
247247
queueMicrotask(() => {
248248
this.emit('load', hit);
@@ -251,7 +251,7 @@ DataHandler.prototype.load = async function load(key) {
251251
}
252252

253253
const data = await fetchData(key);
254-
this._cache.set(url, data);
254+
this._cache.set(key, data);
255255
this.emit('load', data);
256256
};
257257
```

0 commit comments

Comments
 (0)