From c7ee1c28b2f635d8c0afe9e5b09adc9e8b0cab68 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 27 Mar 2022 17:43:01 +0600 Subject: [PATCH] fix of docs for DefaultStatesManager --- .../micro_utils/fsm/common/managers/DefaultStatesManager.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/managers/DefaultStatesManager.kt b/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/managers/DefaultStatesManager.kt index 30b899da341..b6e9556855c 100644 --- a/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/managers/DefaultStatesManager.kt +++ b/fsm/common/src/commonMain/kotlin/dev/inmo/micro_utils/fsm/common/managers/DefaultStatesManager.kt @@ -39,13 +39,16 @@ interface DefaultStatesManagerRepo { * @param repo This repo will be used as repository for storing states. All operations with this repo will happen BEFORE * any event will be sent to [onChainStateUpdated], [onStartChain] or [onEndChain]. By default, will be used * [InMemoryDefaultStatesManagerRepo] or you may create custom [DefaultStatesManagerRepo] and pass as [repo] parameter + * @param onStartContextsConflictResolver Receive current [State] and the state passed with [startChain]. In case when + * this callback will return true, currently placed on the [State.context] [State] will be replaced by new state + * with [endChain] with current state * @param onUpdateContextsConflictResolver Receive old [State], new one and the state currently placed on new [State.context] * key. In case when this callback will returns true, the state placed on [State.context] of new will be replaced by * new state by using [endChain] with that state */ open class DefaultStatesManager( protected val repo: DefaultStatesManagerRepo = InMemoryDefaultStatesManagerRepo(), - protected val onStartContextsConflictResolver: suspend (old: T, new: T) -> Boolean = { _, _ -> true }, + protected val onStartContextsConflictResolver: suspend (current: T, new: T) -> Boolean = { _, _ -> true }, protected val onUpdateContextsConflictResolver: suspend (old: T, new: T, currentNew: T) -> Boolean = { _, _, _ -> true } ) : StatesManager { protected val _onChainStateUpdated = MutableSharedFlow>(0)