Skip to content

Commit

Permalink
Revert "[#2857] Add Suspension support for multiplatform settings (#2859
Browse files Browse the repository at this point in the history
)"

This reverts commit 5eaa8b1
  • Loading branch information
mustafaozhan committed Mar 24, 2024
1 parent 5662756 commit 1e04171
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ import com.oztechan.ccc.client.core.persistence.FlowPersistence
import com.oztechan.ccc.client.core.persistence.FlowPersistenceImpl
import com.oztechan.ccc.client.core.persistence.Persistence
import com.oztechan.ccc.client.core.persistence.PersistenceImpl
import com.oztechan.ccc.client.core.persistence.SuspendPersistence
import com.oztechan.ccc.client.core.persistence.SuspendPersistenceImpl
import com.russhwolf.settings.ObservableSettings
import com.russhwolf.settings.Settings
import com.russhwolf.settings.SharedPreferencesSettings
import com.russhwolf.settings.coroutines.SuspendSettings
import com.russhwolf.settings.coroutines.toSuspendSettings
import org.koin.core.module.dsl.bind
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module
Expand All @@ -21,16 +17,10 @@ private const val KEY_APPLICATION_PREFERENCES = "application_preferences"

actual val clientCorePersistenceModule = module {
singleOf(::provideSharedPreferences)

single<ObservableSettings> { SharedPreferencesSettings(get()) }
single<Settings> { get<ObservableSettings>() }
@Suppress("OPT_IN_USAGE")
single<SuspendSettings> { get<ObservableSettings>().toSuspendSettings() }

singleOf(::PersistenceImpl) { bind<Persistence>() }
singleOf(::FlowPersistenceImpl) { bind<FlowPersistence>() }
@Suppress("OPT_IN_USAGE")
singleOf(::SuspendPersistenceImpl) { bind<SuspendPersistence>() }
}

private fun provideSharedPreferences(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import com.oztechan.ccc.client.core.persistence.FlowPersistence
import com.oztechan.ccc.client.core.persistence.FlowPersistenceImpl
import com.oztechan.ccc.client.core.persistence.Persistence
import com.oztechan.ccc.client.core.persistence.PersistenceImpl
import com.oztechan.ccc.client.core.persistence.SuspendPersistence
import com.oztechan.ccc.client.core.persistence.SuspendPersistenceImpl
import com.russhwolf.settings.NSUserDefaultsSettings
import com.russhwolf.settings.ObservableSettings
import com.russhwolf.settings.Settings
import com.russhwolf.settings.coroutines.SuspendSettings
import com.russhwolf.settings.coroutines.toSuspendSettings
import org.koin.core.module.dsl.bind
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module
Expand All @@ -20,11 +16,6 @@ actual val clientCorePersistenceModule = module {
NSUserDefaultsSettings(get<NativeDependencyWrapper>().userDefaults)
}
single<Settings> { get<ObservableSettings>() }
@Suppress("OPT_IN_USAGE")
single<SuspendSettings> { get<ObservableSettings>().toSuspendSettings() }

singleOf(::PersistenceImpl) { bind<Persistence>() }
singleOf(::FlowPersistenceImpl) { bind<FlowPersistence>() }
@Suppress("OPT_IN_USAGE")
singleOf(::SuspendPersistenceImpl) { bind<SuspendPersistence>() }
}

0 comments on commit 1e04171

Please sign in to comment.