Skip to content

Commit 47c67de

Browse files
committed
Move code to demo folder
1 parent d7414ce commit 47c67de

File tree

9 files changed

+7
-3
lines changed

9 files changed

+7
-3
lines changed
File renamed without changes.
File renamed without changes.

README.md renamed to 03 Run to completion/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ btn.addEventListener('click', (evt) => {
1313

1414
* In this listener we have three statements, first, we stop the propagation of the event, then we modify the page changing its background color and adding a p tag element, for last we have a `blocking operation`.
1515

16-
* Before click the button ask the students, what they think it's going to happen?
17-
* When we click the button, we can watck the screen block, after 10 seconds the screen turns lime, the text is added, and we can interact with the screen again.
16+
* Before we click the button, we can ask ourselves, what it's going to happen?
17+
* When we click the button, we can watch the screen block, after 10 seconds the screen turns lime, the text is added, and we can interact with the screen again.
1818
* When we get to the blocking process, `blockingOperation()` statement, the statement that it's going to be around 10 seconds, anything else can be executed, what means that we can interact with the browser.
1919

2020
* The event listener callback, it's executed till completion, that includes obviously the blocking process. If it takes 10 seconds to get completed, nothing else in that range of time will be executed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="UTF-8">
56
<meta name="viewport" content="width=device-width, initial-scale=1.0">
67
<meta http-equiv="X-UA-Compatible" content="ie=edge">
78
<link rel="stylesheet" href="content/site.css">
89
<title>Document</title>
910
</head>
11+
1012
<body>
13+
<button id="button">Click me!</button>
1114
<script src="./js/main.js"></script>
1215
</body>
16+
1317
</html>

src/js/main.js renamed to 03 Run to completion/src/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ document.onreadystatechange = () => {
1010
const modifyPage = () => {
1111
// modify page
1212
document.body.style.backgroundColor = 'lime';
13-
let p = document.createElement("p");
13+
const p = document.createElement("p");
1414
p.innerText = "let's add some text to the page";
1515
document.body.appendChild(p);
1616
};

0 commit comments

Comments
 (0)