@gmod/jbrowse
Version:
JBrowse - client-side genome browser
23 lines (22 loc) • 554 B
JavaScript
define(['dojo/_base/declare'], function(declare) {
return declare(null, {
constructor: function(fun) {
this.fun = fun;
this.count = 0;
this.finished = false;
},
inc: function() {
this.count++;
},
dec: function() {
this.count--;
this.finish();
},
finish: function() {
if (this.count <= 0 && !this.finished) {
this.fun();
this.finished = true;
}
}
});
});