Created
September 25, 2019 20:06
-
-
Save vertcitron/ec35d2545dbc1355e31b3d1cf78675d9 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
import TextInput from "./components/TextInput" | |
const appElement = document.getElementById('app') | |
const textInput = new TextInput() | |
textInput.placeholder = 'Enter text here...' | |
textInput.value = '' | |
textInput.onInput = (value: string) => { | |
console.log('Input event - value =', value) | |
} | |
textInput.onChange = (value: string) => { | |
console.log('Change event - value =', value) | |
} | |
function renderApp() { | |
if (appElement !== null) { | |
appElement.innerHTML = '' | |
textInput.render(appElement) | |
} | |
} | |
renderApp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment