Skip to content

Commit

Permalink
make "nameByType" public
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek-12 committed Jan 4, 2024
1 parent 7e1ba4c commit 265659e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import pro.respawn.flowmvi.savedstate.api.Saver
*/
public fun <T> JsonSaver(
json: Json,
delegate: Saver<String>,
serializer: KSerializer<T>,
delegate: Saver<String>,
@BuilderInference recover: suspend (Exception) -> T? = { e -> // TODO: Compiler bug does not permit inlining this

Check notice on line 16 in savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

savedstate/src/commonMain/kotlin/pro/respawn/flowmvi/savedstate/dsl/JsonSaver.kt#L16

This comment contains 'TODO:' that has been defined as forbidden in detekt.
delegate.recover(e)?.let { json.decodeFromString(serializer, it) }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reified T> nameByType(): String? = T::class.simpleName?.removeSuffix("State")
/**
* Get the name of the class, removing the "State" suffix, if present
*/
public inline fun <reified T> nameByType(): String? = T::class.simpleName?.removeSuffix("State")

@PublishedApi
internal val PluginNameSuffix: String = "SaveStatePlugin"
Expand Down

0 comments on commit 265659e

Please sign in to comment.