Package 

Class LifecycleAwareFlowKt

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> Flow<T> rememberLifecycleFlow(Flow<T> flow, Lifecycle.State lifecycleState, LifecycleOwner lifecycleOwner) Create and remember a new Flow that is only collected when lifecycleOwner is in lifecycleState
      final static <T extends R, R extends Any> State<R> collectAsStateOnLifecycle(Flow<T> $self, R initial, CoroutineContext context, Lifecycle.State lifecycleState) Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState
      final static <T extends Any> State<T> collectAsStateOnLifecycle(StateFlow<T> $self, CoroutineContext context, Lifecycle.State lifecycleState) Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState
      final static <T extends Any> Unit collectOnLifecycle(Flow<T> $self, Lifecycle.State lifecycleState, SuspendFunction2<CoroutineScope, T, Unit> collector) Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • rememberLifecycleFlow

        @Composable() final static <T extends Any> Flow<T> rememberLifecycleFlow(Flow<T> flow, Lifecycle.State lifecycleState, LifecycleOwner lifecycleOwner)

        Create and remember a new Flow that is only collected when lifecycleOwner is in lifecycleState

      • collectAsStateOnLifecycle

        @Composable()@Deprecated(message = Use Androidx collectAsStateWithLifecycle instead) final static <T extends R, R extends Any> State<R> collectAsStateOnLifecycle(Flow<T> $self, R initial, CoroutineContext context, Lifecycle.State lifecycleState)

        Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState

      • collectAsStateOnLifecycle

        @Composable()@Deprecated(message = Use Androidx collectAsStateWithLifecycle instead) final static <T extends Any> State<T> collectAsStateOnLifecycle(StateFlow<T> $self, CoroutineContext context, Lifecycle.State lifecycleState)

        Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState

      • collectOnLifecycle

        @Composable()@Deprecated(message = Use Androidx collectAsStateWithLifecycle instead) final static <T extends Any> Unit collectOnLifecycle(Flow<T> $self, Lifecycle.State lifecycleState, SuspendFunction2<CoroutineScope, T, Unit> collector)

        Create and collect a Flow that is only collected when LocalLifecycleOwner is in lifecycleState