Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Queue(q) {"use strict";
- // (C) WebReflection - Mit Style License
- var
- next = function next() {
- return (callback = q.shift()) ? !!callback(q) || !0 : !1;
- },
- callback
- ;
- (q.wait = function wait(condition, delay) {
- condition || callback && q.unshift(callback);
- setTimeout(q.next = next, delay || 0);
- })(1);
- return q;
- }
Add Comment
Please, Sign In to add comment