Created
October 17, 2019 11:01
-
-
Save hmil/f7f741878eb8dac6da78b011c00a9f41 to your computer and use it in GitHub Desktop.
imperative-frontend-end
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
function buildUI() { | |
const window = createWindow(); | |
const btn = createButton(); | |
const label = createLabel(); | |
let visitorNumber = 0; | |
label.text = `Hello visitor nr ${visitorNumber}`; | |
btn.label = "click me"; | |
btn.onClick = () => { | |
// Update visitor label | |
visitorNumber = visitorNumber + 1; | |
label.text = `Hello visitor nr ${visitorNumber}` | |
}; | |
window.append(label); | |
window.append(btn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment