rememberOnRoute

inline fun <T : @Serializable Any> rememberOnRoute(key: Any = T::class, noinline block: @DisallowComposableCalls RouterContext.() -> T): T

Scopes instance of T to the current route

Parameters

key

key to remember the instance with. Defaults to T's io.github.xxfast.decompose.router.key

block

lambda to create an instance of T with a given RouterContext


fun <T : Any> rememberOnRoute(type: KClass<T>, key: Any = type.key, block: @DisallowComposableCalls RouterContext.() -> T): T

Deprecated

Use the inline variant above

Scopes instance of T to the current route

Parameters

type

class of T instance

key

key to remember the instance with. Defaults to type's io.github.xxfast.decompose.router.key

block

lambda to create an instance of T with a given RouterContext