@@ -487,14 +487,17 @@ Type: `Array`, `String` or `Function`
487
487
A task name, a function or an array of either.
488
488
489
489
490
- ### gulp.watch(glob[ , opts] , tasks )
490
+ ### gulp.watch(glob[ , opts] , fn )
491
491
492
492
Watch files and do something when a file changes.
493
493
494
494
``` js
495
495
gulp .watch (' js/**/*.js' , gulp .parallel (' uglify' , ' reload' ));
496
496
```
497
497
498
+ In the example, ` gulp.watch ` runs the function returned by gulp.parallel each
499
+ time a file with the ` js ` extension in ` js/ ` is updated.
500
+
498
501
#### glob
499
502
Type: ` String ` or ` Array `
500
503
@@ -505,17 +508,10 @@ Type: `Object`
505
508
506
509
Options, that are passed to [ ` gaze ` ] [ gaze ] .
507
510
508
- #### tasks
509
- Type: ` Array ` , ` Function ` or ` String `
510
-
511
- A task name, a function or an array of either to run when a file changes.
511
+ #### fn
512
+ Type: ` Function `
512
513
513
- When ` tasks ` is an array, the tasks will be run in parallel:
514
- ```
515
- gulp.watch('*.js', [one, two]);
516
- // is equivalent to
517
- gulp.watch('*.js', gulp.parallel(one, two));
518
- ```
514
+ An [ async] ( #async-support ) function to run when a file changes.
519
515
520
516
` gulp.watch ` returns an ` EventEmitter ` object which emits ` change ` events with
521
517
the [ gaze] ` event ` :
0 commit comments