diff --git a/src/jsMain/kotlin/client.kt b/src/jsMain/kotlin/client.kt index 58feb53..440338c 100644 --- a/src/jsMain/kotlin/client.kt +++ b/src/jsMain/kotlin/client.kt @@ -43,11 +43,9 @@ suspend fun main() { rsocket.fireAndForget(buildPayload { data(Json.encodeToString(event)) }) } - - var count: Int by mutableStateOf(0) - renderComposable(rootElementId = "root") { val scope = rememberCoroutineScope() + var count: Int by remember{ mutableStateOf(0)} fun setCount(value: Int) { count = value @@ -62,7 +60,7 @@ suspend fun main() { if (event is CounterDataEvent) { count = event.value } - }.launchIn(scope) + }.launchIn(this) } Div({ style { padding(25.px) } }) {