Created
May 18, 2017 13:08
-
-
Save fraaalk/21d12dba1c8d743ec78aeaad48f78e9c 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
| const moduleFactory = function moduleFactoryFn(moduleName = '') { | |
| const module = function moduleConstructor(element = null, options = {}) { | |
| // call init function of module | |
| this.init(); | |
| } | |
| module.prototype.baseFunctionality1() { | |
| }; | |
| module.prototype.baseFunctionality2() { | |
| }; | |
| return module; | |
| } | |
| module.exports = moduleFactory; |
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
| const Modal = require('./../../components/modal/modal.js'); | |
| const Movie = require('./../../components/base-component/base-component.js')('movie'); | |
| Movie.prototype.init = function init() { | |
| // stuff | |
| } | |
| Movie.prototype.showModal = function showModal($elem) { | |
| const modal = new Modal($elem, { | |
| foo: 'bar' | |
| }); | |
| } | |
| module.exports = Movie; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment