Wrapping up the code for understanding.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"description": "Source code for the Pluralsight course JavaScript Promises and Async Programming",
|
"description": "Source code for the Pluralsight course JavaScript Promises and Async Programming",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"api": "json-server "
|
"dev": "nodemon ./index.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function raceCondition() {
|
|||||||
}
|
}
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
setText(description);
|
setText(`Order Status: ${description}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
xhr2.send();
|
xhr2.send();
|
||||||
@@ -45,7 +45,7 @@ export function callbacks() {
|
|||||||
xhr3.onload = () => {
|
xhr3.onload = () => {
|
||||||
const {description} = JSON.parse(xhr3.responseText);
|
const {description} = JSON.parse(xhr3.responseText);
|
||||||
|
|
||||||
setText(description);
|
setText(`Order Item Category: ${description}`);
|
||||||
}
|
}
|
||||||
xhr3.onerror = () => setText(xhr3.statusText);
|
xhr3.onerror = () => setText(xhr3.statusText);
|
||||||
xhr3.send();
|
xhr3.send();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
||||||
<title>JavaScript Promises and Async Programming</title>
|
<title>JavaScript Promises and Async Programming</title>
|
||||||
<meta name="author" content="Nate Taylor">
|
<meta name="author" content="Nate Taylor">
|
||||||
</meta>
|
</meta>
|
||||||
@@ -24,7 +23,7 @@
|
|||||||
<h1>Results</h1>
|
<h1>Results</h1>
|
||||||
</div>
|
</div>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {raceCondition, callbacks} from "./src/understanding.mjs";
|
import { raceCondition, callbacks } from "./src/understanding.mjs";
|
||||||
|
|
||||||
window.race = raceCondition;
|
window.race = raceCondition;
|
||||||
window.callbacks = callbacks;
|
window.callbacks = callbacks;
|
||||||
|
|||||||
Reference in New Issue
Block a user