This repository has been archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize task() and add another method for it
- Loading branch information
1 parent
dea1006
commit ef3e3c2
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Manages tasks. Provides various gupp.task's. | ||
*/ | ||
import {emitter} from '.'; | ||
|
||
export function taskCb(name, cb) { | ||
emitter.on(`tasks.${name}`, cb); | ||
} | ||
|
||
export function taskDepsCb(name, deps, cb) { | ||
deps.forEach(dep => { | ||
emitter.on(`tasks.${name}`, () => (emitter.emit(`tasks.${dep}`))); | ||
}); | ||
|
||
emitter.on(`tasks.${name}`, cb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters