Skip to content

Commit f8493bb

Browse files
committed
Added opertaion order demo
1 parent 47c67de commit f8493bb

File tree

9 files changed

+3147
-0
lines changed

9 files changed

+3147
-0
lines changed
File renamed without changes.

04 Operation Order/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## What is the order of the prinrt numbers in console?
2+
3+
1, 5, 2, 4, 3
4+
5+
* `setTimeout`, is another function that plans another async function, as web request would do.
6+
* We obtain this result due to run to completion.
7+
* The browser gives to these function a min value of 4ms.

04 Operation Order/gulpfile.js

Lines changed: 24 additions & 0 deletions
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)