Last active
July 30, 2020 02:29
-
-
Save ShikaSD/7c2822efebd12c0049b7172c06b2a886 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
object Click : Event { | |
override val type: String = "click" | |
object Payload : Event.Payload<Click> { | |
override val descriptor: Click = Click | |
} | |
class Callback(override val onReceive: (payload: Payload) -> Unit) : Event.Callback<Click, Payload> { | |
override val descriptor: Click = Click | |
} | |
} | |
@Composable | |
fun Test() { | |
// usage | |
var counter by state { 0 } | |
val clickEvent = Click.Callback { counter++ } | |
tag(tagName = "button", events = listOf(clickEvent)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment