1
0
mirror of https://github.com/mihonapp/mihon.git synced 2025-09-18 18:58:46 +02:00

Singleton instance of Json serializer

This commit is contained in:
arkon
2020-11-01 15:12:16 -05:00
parent 9b10e851d1
commit d21c147203
11 changed files with 57 additions and 26 deletions

@@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.source.SourceManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json
import uy.kohesive.injekt.api.InjektModule
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.addSingleton
@@ -44,6 +45,8 @@ class AppModule(val app: Application) : InjektModule {
addSingletonFactory { Gson() }
addSingletonFactory { Json { ignoreUnknownKeys = true } }
// Asynchronously init expensive components for a faster cold start
GlobalScope.launch { get<PreferencesHelper>() }