Created
August 31, 2017 15:47
-
-
Save jecfish/a46a2462f6f3d92e0858096425fd11f6 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
// index.ts | |
import * as kebabCase from 'lodash/fp/kebabCase'; | |
import { MyApp } from './app'; | |
import { MyTopBar } from './top-bar'; | |
import { MyTopMessage } from './top-message'; | |
import { MyCards } from './cards'; | |
import { MyPopUpModal } from './pop-up-modal'; | |
// add custom elements here | |
const elements = { | |
MyApp, | |
MyTopBar, | |
MyTopMessage, | |
MyCards, | |
MyPopUpModal, | |
}; | |
// register all components as kebab case | |
Object.keys(elements) | |
.forEach(key => { | |
customElements.define(kebabCase(key), elements[key]) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment