NetworkStateImplRepo

open class NetworkStateImplRepo(createNetworkManager: suspend () -> NetworkManager, coroutineContext: CoroutineContext) : BaseNetworkStateRepo

A BaseNetworkStateRepo managed using a NetworkManager

Parameters

createNetworkManager

method for creating the NetworkManager to manage the NetworkState

coroutineContext

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

Inheritors

Constructors

Link copied to clipboard
constructor(createNetworkManager: suspend () -> NetworkManager, coroutineContext: CoroutineContext)

Properties

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

Functions

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

Transforms a Flow of NetworkState into a flow of its associated NetworkConnectionType

Link copied to clipboard
suspend override fun noMoreCollections(): NetworkState
Link copied to clipboard
fun Flow<NetworkState>.online(): Flow<Boolean>

Transforms a Flow of NetworkState into a flow indicating the network is considered to be available.

Link copied to clipboard
Link copied to clipboard
suspend fun takeAndChangeState(action: suspend (NetworkState) -> suspend () -> NetworkState): NetworkState
suspend fun <K : NetworkState> takeAndChangeState(remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> NetworkState): NetworkState
Link copied to clipboard
suspend fun <Result> useState(action: suspend (NetworkState) -> Result): Result