diff --git a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt index 5d490bfd..2a5ac224 100644 --- a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt +++ b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt @@ -11,8 +11,8 @@ import pro.respawn.flowmvi.savedstate.api.Saver */ public fun JsonSaver( json: Json, - delegate: Saver, serializer: KSerializer, + delegate: Saver, @BuilderInference recover: suspend (Exception) -> T? = { e -> // TODO: Compiler bug does not permit inlining this delegate.recover(e)?.let { json.decodeFromString(serializer, it) } }, diff --git a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt index 2b14beee..4f4e380b 100644 --- a/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt +++ b/savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/plugins/SavedStatePlugin.kt @@ -26,8 +26,10 @@ import pro.respawn.flowmvi.savedstate.dsl.NoOpSaver import pro.respawn.flowmvi.savedstate.dsl.TypedSaver import kotlin.coroutines.CoroutineContext -@PublishedApi -internal inline fun nameByType(): String? = T::class.simpleName?.removeSuffix("State") +/** + * Get the name of the class, removing the "State" suffix, if present + */ +public inline fun nameByType(): String? = T::class.simpleName?.removeSuffix("State") @PublishedApi internal val PluginNameSuffix: String = "SaveStatePlugin"