2021-03-07 20:58:47 +01:00
|
|
|
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
|
2021-03-12 21:18:03 +01:00
|
|
|
import kotlinx.coroutines.CoroutineScope
|
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
|
import kotlinx.coroutines.launch
|
2021-03-07 20:58:47 +01:00
|
|
|
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")) {
|
2021-03-12 21:18:03 +01:00
|
|
|
App {
|
2021-03-07 20:58:47 +01:00
|
|
|
dependencies = AppDependencies
|
2021-03-06 20:20:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-07 20:58:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
object AppDependencies : KoinComponent {
|
2021-03-12 21:18:03 +01:00
|
|
|
val appScope = CoroutineScope(Dispatchers.Default)
|
2021-03-07 20:58:47 +01:00
|
|
|
val logger: Kermit
|
|
|
|
val directories: Dir
|
|
|
|
val fetchPlatformQueryResult: FetchPlatformQueryResult
|
|
|
|
init {
|
|
|
|
initKoin()
|
|
|
|
directories = get()
|
|
|
|
logger = get()
|
|
|
|
fetchPlatformQueryResult = get()
|
2021-03-12 21:18:03 +01:00
|
|
|
appScope.launch {
|
|
|
|
//fetchPlatformQueryResult.spotifyProvider.authenticateSpotifyClient(true)
|
|
|
|
}
|
2021-03-07 20:58:47 +01:00
|
|
|
}
|
2021-03-06 20:20:07 +01:00
|
|
|
}
|