Skip to content

Commit f86afa0

Browse files
committed
Added code to how avoid blocking
1 parent 04ce416 commit f86afa0

File tree

11 files changed

+3387
-5
lines changed

11 files changed

+3387
-5
lines changed

01 Non blocking/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## In orde to get the demo working:
1+
## In order to get the code working:
22

33
* Open terminal at the same level as `package.json`, and type:
44
```bash

02 How to avoid blocking/README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
## En esta demo vamos a ver como establecer la naturaleza no bloqueante de JS
1+
## In order to get the code working:
2+
3+
* Open terminal at the same level as `package.json`, and type:
4+
```bash
5+
$ npm install
6+
```
7+
* After installation, we can run the application using:
8+
```bash
9+
$ npm install
10+
```
11+
* To get results on the open browser app:
12+
* house: `House Lannister of Casterly Rock`
13+
* character input: `Jaime Lannister`
14+
15+
## In this demo we are going to stablish the blocking nature of JavaScript
216

317
## Steps.
418

@@ -42,9 +56,7 @@ var apiWeather = apiWeather || {};
4256
})(apiWeather);
4357

4458
```
45-
46-
* De esta manera XHR, funciona de manera síncrona.
47-
* Mirar los console logs para ver en que orden se ejecutan las cosas.
59+
* This way `XHR` work SYNC.
4860

4961
### 2. Now if we change these values again we can watch that goes on parallel
5062

02 How to avoid blocking/gulpfile.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
const gulp = require('gulp'),
4+
connect = require('gulp-connect'),
5+
open = require('gulp-open'),
6+
options = {
7+
port: 9005,
8+
root: ['src'],
9+
devBase: 'http://localhost:',
10+
browsers: ['safari', 'chrome']
11+
},
12+
openOptions = {
13+
uri: options.devBase + options.port,
14+
app: options.browser
15+
};
16+
17+
gulp.task('connect', () => connect.server({
18+
root: options.root,
19+
port: options.port
20+
}));
21+
// https://github.com/stevelacy/gulp-open/issues/15
22+
gulp.task('open', () => gulp.src(__filename).pipe(open(openOptions)));
23+
24+
gulp.task('default', ['connect', 'open']);

0 commit comments

Comments
 (0)