Skip to content

Commit fa248fa

Browse files
committedApr 25, 2019
fixe demo readme's
1 parent 6512d1e commit fa248fa

File tree

7 files changed

+33
-9
lines changed

7 files changed

+33
-9
lines changed
 

‎03 Run to completion/README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
## Run to completion
22

3-
### 1. Let's creae code that will be blocking in some pint.
3+
* The html for this demo
4+
5+
```html
6+
<!DOCTYPE html>
7+
<html lang="en">
8+
9+
<head>
10+
<meta charset="UTF-8">
11+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
12+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
13+
<link rel="stylesheet" href="content/site.css">
14+
<title>Document</title>
15+
</head>
16+
17+
<body>
18+
<button id="button">Click me!</button>
19+
<script src="./js/main.js"></script>
20+
</body>
21+
22+
</html>
23+
24+
```
25+
26+
### 1. Let's creae code that will be blocking in some point.
427

528
```javascript
629
document.onreadystatechange = () => {

‎05 User interactions/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ https://codepen.io/patrickhlauke/pen/azbYWZ
2525
<html lang="en">
2626
<head>
2727
<meta charset="utf-8">
28-
<title>LEMONCODE 16/17 jQuery</title>
28+
<title>User interactions demo</title>
2929
<link rel="stylesheet" href="content/site.css">
3030
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
3131
</head>
3232

3333
<body>
34-
<h1>API Rest</h1>
34+
<h1>Drag and drop</h1>
3535
<div id="drag-element" draggable="true" class="drag"></div>
3636
<br>
3737
<div id="drop-element-a" class="drop"></div>

‎05 User interactions/src/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<link rel="stylesheet" href="content/site.css">
9-
<title>Document</title>
9+
<title>User interactin demo</title>
1010
</head>
1111

1212
<body>
13+
<h1>Drag and drop</h1>
1314
<div id="drag-element" draggable="true" class="drag"></div>
1415
<br>
1516
<div id="drop-element-a" class="drop"></div>
1617
<div id="drop-element-b" class="drop"></div>
1718
<script src="./js/main.js"></script>
1819
</body>
1920

20-
</html>
21+
</html>

‎06 Source Timers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ document.getElementById('content').innerHTML = 'Main content from JS';
112112
+ document.getElementById('content').innerHTML = 'Main content from JS';
113113
+}, 100);
114114
```
115-
* En la función de arriba, cuando pasen 100 ms, esa función que estamos suministrando aquí será empujada a la cola del event loop, y una vez que se ejecute, lo que sea que estuvierá por delante se ejecuté, entonces después esta, función comnzará su ejecución. Esto, nos muestra un aspecto importante de esta función, no hay garatía sea llamada exactamente a los 100ms, cuando es alcanzada. A los 100ms, será empujada a la cola, pero si hay mucho trabajo, en frente, tendrá que esperar a que ese trabajo, se ejecute antes.
115+
* En la función de arriba, cuando pasen 100 ms, esa función que estamos suministrando aquí será empujada a la cola del event loop, y una vez que se ejecute, lo que sea que estuvierá por delante se ejecuté, entonces después esta, función comnzará su ejecución. Esto, nos muestra un aspecto importante de esta función, no hay garantía de que sea llamada exactamente a los 100ms, cuando es alcanzada en la ejecución de la hebra princpal. A los 100ms, será empujada a la cola, pero si hay mucho trabajo, en frente, tendrá que esperar a que ese trabajo, se ejecute antes.
116116

117117
* Analogía con un dietario.

‎09 Web Workers/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ body {
118118
```javascript inline.js
119119
(() => {
120120
const longTask = (progressCalback) => {
121-
for (let step = 0; step < 10; step++) {
121+
for (let step = 0; step <= 10; step++) {
122122
progressCalback(step * 10);
123123
/*
124124
Use the developer tools to show that the console log is not blocked

‎server-in-memory/routes/cars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ router.route('/:id')
5858
.get((req, res) => {
5959
var data = getCarData();
6060
var matchingCar = data.find(
61-
(item) => item.car_id === req.params.id
61+
(item) => item.car_id === +req.params.id
6262
);
6363

6464
if(!matchingCar) {

‎server-in-memory/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const jwtCheck = expressjwt({
2121

2222

2323
app.use('/api/users', jwtCheck, users);
24-
app.use('/api/cars', jwtCheck, cars);
24+
app.use('/api/cars', cars);
2525

2626

2727
app.set('port', process.env.PORT || 3050);

0 commit comments

Comments
 (0)
Please sign in to comment.