avril.queue
avril.queue is an async flow control tool, it tries to ease the pain of callback.
It's pretty simple to use. Let's rock.
install avril.queue
npm install avril.queue
for now avril.queue only support node env, I would try to make it support the browsers later.
/*
assume that we have a file "the/path/of/file.txt"
the file content is :
1
2
3
*/
func, $await , $each
var avQ = ;var q = ; /* return $AwaitData object */var $fileContent = q; /* conver the $awaitData' result , return a new $AwaitData object */var $ids = $fileContent; /* return $AwaitData object which result is list of */var $users = q; q;
$$await & $$each
var avQ = ;var q = ; /* return $AwaitData object */var $fileContent = q; /* conver the $awaitData' result , return a new $AwaitData object */var $ids = $fileContent; /* return $AwaitData object which result is list of */var $users = q; q;
use $await, $each, with context
var avQ = ;var q = ; /* return $AwaitData object */var $fileContent = q; /* conver the $awaitData' result , return a new $AwaitData object */var $ids = $fileContent; /* return $AwaitData object which result is list of */var $users = q; q;
use q.$if($awaitData, trueFunc).$else(falseFunc)
var avQ = ;var q = ;var filePath = 'the/path/of/file.txt';var $fileExisted = q;var $fileContent;qq; var otherPath = 'the/path/of/otherFile.txt'; q; q