Skip to content

Instantly share code, notes, and snippets.

@vertcitron
Created September 25, 2019 20:06
Show Gist options
  • Save vertcitron/ec35d2545dbc1355e31b3d1cf78675d9 to your computer and use it in GitHub Desktop.
Save vertcitron/ec35d2545dbc1355e31b3d1cf78675d9 to your computer and use it in GitHub Desktop.
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