KotlinX HTML with coroutines

Submitted by Dickens A S on Mon, 11/04/2019 - 16:10

use KotlinX with coroutines to create a delay in HTML rendering

var detectDiv = GlobalScope.launch {
	delay(2000L) //wait for 2 second browser ready hack
	val myDiv = document.create.div {
		p { +"some text " }
		div { +"my div tag" }
	}

	var root = document.getElementById("root")
	root?.append(myDiv)
}

Source Code

End Of Article

Add new comment