Skip to content

Instantly share code, notes, and snippets.

@zzarcon
Created Oct 14, 2017
Embed
What would you like to do?
import runWhen from 'run-when';
runWhen([
{
glob: ['app/components/index.js', 'app/__tests__/**'],
task(paths) {
console.log('This will be called!');
}
},
{
glob: ['!package.json'],
task(paths) {
return Promise.resolve('You can return a promise from your task');
}
},
{
// Optionally pass changed files
changedFiles: () => Promise.resolve(['app/index.js', 'app/components/header.jsx']),
glob: ['app/components/**'],
task(paths) {
console.log(paths === ['app/components/header.jsx']);
}
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment