Package-level declarations

Types

Link copied to clipboard
sealed interface BatchingMode

The mode of batching for the batchIntentsDecorator.

Link copied to clipboard

Queue holder of the batchIntentsDecorator.

Link copied to clipboard
data class RetryStrategy

Retry strategy used with retryIntentsDecorator and retryActionsDecorator.

Functions

Link copied to clipboard
fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.batchIntents(mode: BatchingMode, name: String? = "BatchIntentsDecorator"): BatchQueue<I>

Installs a new batchIntentsDecorator for all plugins of this store.

Link copied to clipboard
fun <S : MVIState, I : MVIIntent, A : MVIAction> batchIntentsDecorator(mode: BatchingMode, queue: BatchQueue<I> = BatchQueue(), name: String? = "BatchIntentsDecorator"): PluginDecorator<S, I, A>

A decorator that batches intents based on the BatchingMode and stores them in a BatchQueue.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.conflateActions(name: String? = "ConflateActions", crossinline compare: (it: A, other: A) -> Boolean = MVIAction::equals)

Installs a new conflateActionsDecorator for all actions in this store.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> conflateActionsDecorator(name: String? = "ConflateActions", crossinline compare: (it: A, other: A) -> Boolean = MVIAction::equals): PluginDecorator<S, I, A>

Conflates intents going through this decorator based on the equality function provided in compare.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.conflateIntents(name: String? = "ConflateIntents", crossinline compare: (it: I, other: I) -> Boolean = MVIIntent::equals)

Returns a new conflateIntentsDecorator for all intents in this store.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> conflateIntentsDecorator(name: String? = "ConflateIntents", crossinline compare: (it: I, other: I) -> Boolean = MVIIntent::equals): PluginDecorator<S, I, A>

Conflates intents going through this decorator based on the equality function provided in compare.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> intentTimeoutDecorator(timeout: Duration, name: String? = "IntentTimeout", crossinline onTimeout: suspend PipelineContext<S, I, A>.(I) -> I? = { throw StoreTimeoutException(timeout) }): PluginDecorator<S, I, A>

Creates a new decorator that runs each StorePlugin.onIntent through a time-out block.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.retryActions(strategy: RetryStrategy = RetryStrategy.Default, name: String? = null, crossinline selector: (action: A, e: Exception) -> Boolean = { _, _ -> true })

Install a retryActionsDecorator over this Store.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> retryActionsDecorator(strategy: RetryStrategy, name: String? = null, crossinline selector: (action: A, e: Exception) -> Boolean = { _, _ -> true }): PluginDecorator<S, I, A>

Install a new decorator that retries invoking StorePlugin.onAction using the specified strategy and selector for choosing whether to retry a given action.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.retryIntents(strategy: RetryStrategy = RetryStrategy.Default, name: String? = null, crossinline selector: (intent: I, e: Exception) -> Boolean = { _, _ -> true })

Install a retryIntentsDecorator over this Store.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> retryIntentsDecorator(strategy: RetryStrategy, name: String? = null, crossinline selector: (intent: I, e: Exception) -> Boolean = { _, _ -> true }): PluginDecorator<S, I, A>

Install a new decorator that retries invoking StorePlugin.onIntent using the specified strategy and selector for choosing whether to retry a given intent.

Link copied to clipboard
inline fun <S : MVIState, I : MVIIntent, A : MVIAction> StoreBuilder<S, I, A>.timeoutIntents(timeout: Duration, name: String? = "IntentTimeout", crossinline onTimeout: suspend PipelineContext<S, I, A>.(I) -> I? = { throw StoreTimeoutException(timeout) })

Installs a new intentTimeoutDecorator for all intents in this store.