Sub Store
class SubStore<R, P, T>(parent: Store<P>, lens: Lens<P, T>, root: Store<R>, rootLens: Lens<R, T>) : Store<T>
Content copied to clipboard
A Store that is derived from your RootStore or another SubStore that represents a part of the data-model of it's parent. Use the .sub-factory-method on the parent Store to create it.
Constructors
Functions
errorHandler
Link copied to clipboard
handle
Link copied to clipboard
open fun handle(errorHandler: ErrorHandler<T> = ::errorHandler, execute: suspend (T) -> T): SimpleHandler<Unit>
Content copied to clipboard
Factory method to create a SimpleHandler that does not take an Action
open fun <A> handle(errorHandler: ErrorHandler<T> = ::errorHandler, execute: suspend (T, A) -> T): SimpleHandler<A>
Content copied to clipboard
Factory method to create a SimpleHandler mapping the actual value of the Store and a given Action to a new value.
handleAndEmit
Link copied to clipboard
open fun <E> handleAndEmit(errorHandler: ErrorHandler<T> = ::errorHandler, execute: suspend FlowCollector<E>.(T) -> T): EmittingHandler<Unit, E>
Content copied to clipboard
open fun <A, E> handleAndEmit(errorHandler: ErrorHandler<T> = ::errorHandler, execute: suspend FlowCollector<E>.(T, A) -> T): EmittingHandler<A, E>
Content copied to clipboard
Factory method to create a EmittingHandler taking an action-value and the current store value to derive the new value.
handledBy
Link copied to clipboard
Properties
update
Link copied to clipboard
a simple SimpleHandler that just takes the given action-value as the new value for the Store.
Extensions
sub
Link copied to clipboard