installIoDispatcher

expect fun installIoDispatcher(dispatcher: CoroutineDispatcher)

Sets the dispatcher that ioDispatcher returns on JS and Wasm.

KiteCore does not ship a dispatcher for the web. Pass your own, for example one that runs tasks in a Web Worker. Call it once at startup, before any code reads ioDispatcher. A later call replaces the earlier dispatcher.

fun main() {
// workerDispatcher is your own dispatcher, for example on a Web Worker.
installIoDispatcher(workerDispatcher)
startApp()
}

On JVM, Android, iOS and macOS the call does nothing, so common code can call it on every target.

Parameters

dispatcher

the dispatcher that ioDispatcher returns on JS and Wasm from now on.