android-components / mozilla.components.feature.customtabs.store / CustomTabsServiceStore

CustomTabsServiceStore

class CustomTabsServiceStore : Store<CustomTabsServiceState, CustomTabsAction> (source)

Constructors

Name Summary
<init> CustomTabsServiceStore(initialState: CustomTabsServiceState = CustomTabsServiceState())

Inherited Properties

Name Summary
state val state: S
The current State.

Inherited Functions

Name Summary
dispatch fun dispatch(action: A): Job
Dispatch an Action to the store in order to trigger a State change.
observeManually fun observeManually(observer: Observer<S>): Subscription<S, A>
Registers an Observer function that will be invoked whenever the State changes.

Extension Functions

Name Summary
channel fun <S : State, A : Action> Store<S, A>.channel(owner: LifecycleOwner = ProcessLifecycleOwner.get()): ReceiveChannel<S>
Creates a conflated Channel for observing State changes in the Store.
flow fun <S : State, A : Action> Store<S, A>.flow(owner: LifecycleOwner? = null): Flow<S>
Creates a Flow for observing State changes in the Store.
flowScoped fun <S : State, A : Action> Store<S, A>.flowScoped(owner: LifecycleOwner? = null, block: suspend (Flow<S>) -> Unit): CoroutineScope
Launches a coroutine in a new MainScope and creates a Flow for observing State changes in the Store in that scope. Invokes block inside that scope and passes the Flow to it.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
observe fun <S : State, A : Action> Store<S, A>.observe(owner: LifecycleOwner, observer: Observer<S>): Unit
Registers an Observer function that will be invoked whenever the state changes. The Store.Subscription will be bound to the passed in LifecycleOwner. Once the Lifecycle state changes to DESTROYED the Observer will be unregistered automatically.fun <S : State, A : Action> Store<S, A>.observe(view: <ERROR CLASS>, observer: Observer<S>): Unit
Registers an Observer function that will be invoked whenever the state changes. The Store.Subscription will be bound to the passed in View. Once the View gets detached the Observer will be unregistered automatically.
observeForever fun <S : State, A : Action> Store<S, A>.observeForever(observer: Observer<S>): Unit
Registers an Observer function that will observe the store indefinitely.