Skip to content

Commit bfb1dc0

Browse files
ashishmauryadanielleadams
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 c68415c commit bfb1dc0

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
@@ -319,7 +319,7 @@ within each turn of the Node.js event loop.
319319
// before any other promise jobs.
320320

321321
DataHandler.prototype.load = async function load(key) {
322-
const hit = this._cache.get(url);
322+
const hit = this._cache.get(key);
323323
if (hit !== undefined) {
324324
queueMicrotask(() => {
325325
this.emit('load', hit);
@@ -328,7 +328,7 @@ DataHandler.prototype.load = async function load(key) {
328328
}
329329

330330
const data = await fetchData(key);
331-
this._cache.set(url, data);
331+
this._cache.set(key, data);
332332
this.emit('load', data);
333333
};
334334
```

0 commit comments

Comments
 (0)