MockPlaybackStateRepo

class MockPlaybackStateRepo(createInitialState: () -> MockPlaybackState, coroutineContext: CoroutineContext) : BasePlaybackStateRepo

Mock implementation of BasePlaybackStateRepo This will only use MockPlaybackState

Parameters

createInitialState

method for creating an initial MockPlaybackState

coroutineContext

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

Constructors

Link copied to clipboard
constructor(configuration: MockPlaybackState.Configuration, coroutineContext: CoroutineContext)

Constructor that initializes to a MockPlaybackState.Uninitialized State with a given MockPlaybackState.Configuration

constructor(createInitialState: () -> MockPlaybackState, 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