Last active
July 12, 2017 23:57
-
-
Save luqmaan/ea1e2edd2ab3661224b3c37609d6a41b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
gulpTask = (name, fn) => { | |
done = (err) => { | |
if (err) { | |
console.log(`Completed task "${name}" with error`); | |
console.error(err) | |
} | |
else { | |
console.log(`Completed task "${name}" successfully`); | |
} | |
} | |
console.log(`Starting task "${name}"`) | |
fn(done); | |
} | |
gulpTask('add numbers', (cb) => { | |
try { | |
console.log(3 + 3) | |
cb() | |
} | |
catch (err) { | |
cb(err) | |
} | |
}) | |
gulpTask('be dumb and use a number like a function', (cb) => { | |
try { | |
100() | |
cb() | |
} | |
catch (err) { | |
cb(err) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment