rememberCloseableOnRoute

fun <T : Closeable> rememberCloseableOnRoute(route: BaseRoute, type: KClass<T>, factory: () -> T): T(source)

Remember a Closeable on the route.

The Closeable will be created by factory once at the first access. It will be closed when the route is removed from the back stack.

Parameters

route

The route to remember the Closeable on.

type

The type of Closeable.

factory

The factory to create the Closeable.


inline fun <T : Closeable> rememberCloseableOnRoute(route: BaseRoute, noinline factory: () -> T): T(source)

Remember a Closeable on the route.

The Closeable will be created by factory once at the first access. It will be closed when the route is removed from the back stack.

Parameters

route

The route to remember the Closeable on.

factory

The factory to create the Closeable.