Updated on 2026-08-14
This commit is contained in:
parent
735d07070d
commit
79f35fe41e
1 changed files with 12 additions and 1 deletions
|
|
@ -102,13 +102,24 @@ internal abstract class BaseStoreHub<State>(
|
|||
}
|
||||
|
||||
protected abstract suspend fun handleAction(action: Action, storeState: DomainState, cancel: ValueCallback<Action>)
|
||||
protected abstract fun reduceAction(action: Action, state: State): State
|
||||
|
||||
@Deprecated(
|
||||
replaceWith = ReplaceWith("ReStoreReducer<T>"),
|
||||
message = "must return a Reducer instance. The reducer must be a separate component - this closes " +
|
||||
"access to the states that can be obtained from ReStoreHub"
|
||||
)
|
||||
abstract fun reduceAction(action: Action, state: State): State
|
||||
// protected abstract fun getReducer(): ReStoreReducer<State>
|
||||
|
||||
protected abstract fun getHubState(storeState: DomainState): State
|
||||
protected abstract fun updateStoreState(storeState: DomainState, newHubState: State): DomainState
|
||||
|
||||
}
|
||||
|
||||
internal interface ReStoreReducer<State> {
|
||||
fun reduceAction(action: Action, state: State): State
|
||||
}
|
||||
|
||||
internal suspend inline fun ReStoreHub<*, *>.dispatchOnMain(vararg actions: Action) {
|
||||
withMainContext { actions.forEach { domainStore.dispatch(it) } }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue