Created
April 11, 2018 18:24
-
-
Save joegaudet/fa23ca36b3461085745c0132cc687a99 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
| // factory-registry.js | |
| export default FactoryRegistry { | |
| static register(name, klass) { | |
| this._factories = this._factories || {}; | |
| this._factories[name] = klass; | |
| } | |
| } | |
| // factory instance | |
| import Factory from './factory-registry.js'; | |
| export default FactoryInstance { | |
| build(){ | |
| // DOIT | |
| } | |
| } | |
| // The problem, in dev this gets invoked, but in production | |
| // it doesn't, is this an ember-cli build optimization to lazily evaluate | |
| // classes? | |
| FactoryRegistry.register('factoryInstance', FactoryInstance) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment