BasePlaybackStateRepo

abstract class BasePlaybackStateRepo(createInitialState: HotStateFlowRepo<PlaybackState>.() -> PlaybackState, coroutineContext: CoroutineContext) : HotStateFlowRepo<PlaybackState>

An abstract ColdStateFlowRepo for managing PlaybackState

Parameters

createInitialState

method for creating the initial PlaybackState given an implementation of this HotStateFlowRepo

coroutineContext

the CoroutineContext the CoroutineContext used to create a coroutine scope for this state machine.

Inheritors

Constructors

Link copied to clipboard
constructor(createInitialState: HotStateFlowRepo<PlaybackState>.() -> PlaybackState, coroutineContext: CoroutineContext)

Properties

Link copied to clipboard
Link copied to clipboard
open override val lazyMutableSharedFlow: Lazy<MutableStateFlow<PlaybackState>>
Link copied to clipboard
open override val stateFlow: StateFlow<PlaybackState>
Link copied to clipboard
val subscriptionCount: StateFlow<Int>

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<PlaybackState>): Nothing
Link copied to clipboard
suspend override fun initialValue(): PlaybackState
Link copied to clipboard
fun launchTakeAndChangeState(context: CoroutineContext, action: suspend (PlaybackState) -> suspend () -> PlaybackState): Job
fun <K : PlaybackState> launchTakeAndChangeState(context: CoroutineContext, remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> PlaybackState): Job
Link copied to clipboard
fun <Result> launchUseState(context: CoroutineContext, action: suspend (PlaybackState) -> Result): Job
Link copied to clipboard
Link copied to clipboard
suspend fun takeAndChangeState(action: suspend (PlaybackState) -> suspend () -> PlaybackState): PlaybackState
suspend fun <K : PlaybackState> takeAndChangeState(remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> PlaybackState): PlaybackState
Link copied to clipboard
suspend fun <Result> useState(action: suspend (PlaybackState) -> Result): Result