Created
July 6, 2018 15:42
-
-
Save stefanpearson/c50fbf8aa2d59d9e672435595260806e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bundle { | |
load(config) { | |
const preconfig = this.preconfig(config); | |
if (typeof preconfig.then === 'function') { | |
return preconfig.then(resolvedPreconfig => { | |
this.config = Object.assign({}, this.config, resolvedPreconfig); | |
this.emit('load', {config: this.config}); | |
}); | |
} else { | |
this.config = Object.assign({}, this.config, preconfig); | |
this.emit('load', {config: this.config}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment