Skip to content

Commit

Permalink
support async function for initFileFn
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Droz committed May 29, 2020
1 parent 45dcba1 commit 5d9e34c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,16 @@
*/
bootstrap: function () {
if (typeof this.flowObj.opts.initFileFn === "function") {
this.flowObj.opts.initFileFn(this);
var ret = this.flowObj.opts.initFileFn(this);
if ('then' in ret) {
ret.then(this._bootstrap.bind(this));
} else {
this._bootstrap();
}
}
},

_bootstrap: function () {
this.abort(true);
this.error = false;
// Rebuild stack of chunks from file
Expand Down

0 comments on commit 5d9e34c

Please sign in to comment.