Created
September 25, 2019 12:39
-
-
Save vertcitron/128774cbb0bb36b01a4c6406a7d4c73d to your computer and use it in GitHub Desktop.
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
import Button from "./components/Button" | |
const appElement = document.getElementById('app') | |
const alertButton = new Button('Alert Button') | |
alertButton.onClick = () => { | |
alert('Alert button was clicked !') | |
} | |
const warningButton = new Button('Warning Button') | |
warningButton.onClick = () => { | |
console.warn('Warning button was clicked !') | |
} | |
function renderApp() { | |
if (appElement !== null) { | |
appElement.innerHTML = '' | |
alertButton.render(appElement) | |
warningButton.render(appElement) | |
} | |
} | |
renderApp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment