-
-
Save brentonhouse/247e62fce91c1b26b1e01b503f7fd110 to your computer and use it in GitHub Desktop.
Custom tags in go-od
This file contains 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 createFunctionsSet = {}; | |
function buildCreatorFor(tagName, controllerName) { | |
const createFuntionName = `create${tagName}`; | |
createFunctionsSet[createFuntionName] = function (args) { | |
return Alloy.createController(controllerName, args).getView(); | |
} | |
} | |
buildCreatorFor('BaseWindow', 'components/common/base-window/BaseWindow'); | |
buildCreatorFor('MenuWindow', 'components/common/menu-window/MenuWindow'); | |
buildCreatorFor('ImageViewer', 'components/common/image-viewer/ImageViewer'); | |
buildCreatorFor('HorizontalScroller', 'components/common/horizontal-scroller/HorizontalScroller'); | |
buildCreatorFor('LoadingContainer', 'components/common/horizontal-scroller/LoadingContainer'); | |
module.exports = createFunctionsSet; // { createBaseWindow: function(args) {...}, createMenuWindow: function(args){...}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment