SpotiFlyer/web-app/src/main/kotlin/client.kt

33 lines
834 B
Kotlin
Raw Normal View History

import co.touchlab.kermit.Kermit
import com.shabinder.common.di.Dir
import com.shabinder.common.di.FetchPlatformQueryResult
import com.shabinder.common.di.initKoin
2021-03-06 20:20:07 +01:00
import react.dom.render
import kotlinx.browser.document
import kotlinx.browser.window
import navbar.navBar
import org.koin.core.component.KoinComponent
import org.koin.core.component.get
2021-03-06 20:20:07 +01:00
fun main() {
window.onload = {
render(document.getElementById("root")) {
navBar {}
app {
dependencies = AppDependencies
2021-03-06 20:20:07 +01:00
}
}
}
}
object AppDependencies : KoinComponent {
val logger: Kermit
val directories: Dir
val fetchPlatformQueryResult: FetchPlatformQueryResult
init {
initKoin()
directories = get()
logger = get()
fetchPlatformQueryResult = get()
}
2021-03-06 20:20:07 +01:00
}