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 targos committed Sep 4, 2021
1 parent dbaf498 commit 53300d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,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 @@ -251,7 +251,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 53300d3

Please sign in to comment.