embark/lib/contracts/code_templates/load-manager.js.ejs

5 lines
432 B
Plaintext
Raw Normal View History

2017-10-14 00:01:35 +00:00
__mainContext.__LoadManager = function() { this.list = []; this.done = false; }
__mainContext.__LoadManager.prototype.execWhenReady = function(cb) { if (this.done) { cb(); } else { this.list.push(cb) } }
__mainContext.__LoadManager.prototype.doFirst = function(todo) { var self = this; todo(function() { self.done = true; self.list.map((x) => x.apply()) }) }
__mainContext.__loadManagerInstance = new __mainContext.__LoadManager();