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 <[email protected]>
Reviewed-By: Harshitha K P <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • 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.