Skip to content

Commit

Permalink
doc: fixed variable names in queueMicrotask example
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ashishmaurya authored and danielleadams committed Aug 16, 2021
1 parent c68415c commit bfb1dc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/globals.md
Expand Up @@ -319,7 +319,7 @@ within each turn of the Node.js event loop.
// before any other promise jobs.

DataHandler.prototype.load = async function load(key) {
const hit = this._cache.get(url);
const hit = this._cache.get(key);
if (hit !== undefined) {
queueMicrotask(() => {
this.emit('load', hit);
Expand All @@ -328,7 +328,7 @@ DataHandler.prototype.load = async function load(key) {
}

const data = await fetchData(key);
this._cache.set(url, data);
this._cache.set(key, data);
this.emit('load', data);
};
```
Expand Down

0 comments on commit bfb1dc0

Please sign in to comment.