conclude

0.1.5 • Public • Published

Run callbacks when all of loadings occured.

conclude.after('all-tasks', function(){
    console.log('All tasks complete');
});
 
// Define tasks with a string
conclude.after('mysql mongo memcache', function(){
    console.log('Ready A');
});
// Define tasks as an Array
conclude.after(['mysql', 'mongo', 'memcache'], function(){
    console.log('Ready B');
});
// Define tasks as arguments
conclude.after('mysql', 'mongo', 'memcache', function(){
    console.log('Ready C');
});
// All styles together
conclude.after(['mysql'], 'mongo memcache', function(){
    console.log('Ready D');
});
 
var complete = conclude.getComplete();
 
process.nextTick(function(){
    // All-tasks will be ready after others
    conclude.task('other').after('memcached mongo mysql');
    // Notify conclude
    conclude.complete('mysql');
    // Notify with closure
    complete('mongo');
    complete('memcache');
});

The output:

Ready A
Ready B
Ready C
Ready D
All tasks complete

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.5
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.5
    2
  • 0.1.4
    0
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i conclude

Weekly Downloads

2

Version

0.1.5

License

BSD

Last publish

Collaborators

  • rumkin