Created
November 26, 2024 17:16
-
-
Save gdotdesign/3b789f270b8e93a514c23503128ac3aa to your computer and use it in GitHub Desktop.
Mint Counter
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
component Counter { | |
state counter = 0 | |
fun increment { | |
next { counter: counter + 1 } | |
} | |
fun decrement { | |
next { counter: counter - 1 } | |
} | |
fun render { | |
<div> | |
<button onClick={decrement}> | |
"Decrement" | |
</button> | |
<span> | |
counter | |
</span> | |
<button onClick={increment}> | |
"Increment" | |
</button> | |
</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment