mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-16 09:34:28 +02:00
BOOMMMMMM async error queues now done, this is so sexy
This commit is contained in:
parent
dbd7913803
commit
459d104fdb
5 changed files with 81 additions and 175 deletions
|
@ -3,7 +3,7 @@ var CommitCollection = Backbone.Collection.extend({
|
|||
});
|
||||
|
||||
var CommandCollection = Backbone.Collection.extend({
|
||||
model: Command
|
||||
model: Command,
|
||||
});
|
||||
|
||||
var CommandBuffer = Backbone.Model.extend({
|
||||
|
@ -36,10 +36,6 @@ var CommandBuffer = Backbone.Model.extend({
|
|||
// timeout existence implies its being processed
|
||||
return;
|
||||
}
|
||||
|
||||
// process first element now
|
||||
this.popAndProcess();
|
||||
// always set the timeout, regardless of buffer size
|
||||
this.setTimeout();
|
||||
},
|
||||
|
||||
|
@ -51,7 +47,7 @@ var CommandBuffer = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
popAndProcess: function() {
|
||||
var popped = this.buffer.pop();
|
||||
var popped = this.buffer.shift(0);
|
||||
var callback = _.bind(function() {
|
||||
this.setTimeout();
|
||||
}, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue