Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var SuccessQueuee = function () {
this.queuee = [];
this.is_ran = false;
};
SuccessQueuee.prototype.push = function (func) {
if (this.is_ran) {
func();
return false;
}
this.queuee.push(func);
};
SuccessQueuee.prototype.pop = function () {
return this.queuee.pop();
};
SuccessQueuee.prototype.run = function () {
if (this.is_ran) {
return false;
}
this.queuee.forEach(function (_func, _func_i) {
_func();
});
this.is_ran = true;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.