Last active
July 9, 2020 22:02
-
-
Save chrisdmacrae/e4abb675b2daae6738ef7df643b7a013 to your computer and use it in GitHub Desktop.
Functional stencil dream
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
@Component({ tag: “falcon-punch” }) | |
export function FalconPunch(props) { | |
@state() let hasPunched: Boolean = false; | |
const doPunch = () => hasPunched = true; | |
@onChange(hasPunched) | |
function handleHasPunchChange() { | |
if (hasPunched) | |
alert(`React just got punched!`) | |
} | |
return ( | |
<button onClick={doPunch} type=“button”>Punch</button> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment