An open API service indexing awesome lists of open source software.

https://github.com/craryprimitiveman/saq

SAQ是指Small Asynchronous Queue,即短小精悍的异步调用库。
https://github.com/craryprimitiveman/saq

Last synced: 4 months ago
JSON representation

SAQ是指Small Asynchronous Queue,即短小精悍的异步调用库。

Awesome Lists containing this project

README

        

SAQ
===

SAQ是指Small Asynchronous Queue,即短小精悍的异步调用库。



var obj = {
value: null
};

saq([
function(callback) {
var self = this;
setTimeout(function() {
self.value = 10;
callback(20);
}, 200);
},
function(callback, add) {
console.log(this.value + add);
callback();
},
function(callback) {
this.value += 10;
console.log(obj.value);
setTimeout(function() {
callback();
}, 200);
},
function() {
console.log("end");
}
], obj);
// 运行结果 30 20 end