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,即短小精悍的异步调用库。
- Host: GitHub
- URL: https://github.com/craryprimitiveman/saq
- Owner: CraryPrimitiveMan
- License: mit
- Created: 2014-03-28T09:09:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-28T09:22:56.000Z (about 11 years ago)
- Last Synced: 2024-12-31T08:47:41.211Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 125 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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