StatefulComputation

Computation of values where the form manager maintains a state of type TState for each managed computation.

Stateful computations are useful when they require expensive operations over data and if it is possible to save the result of such expensive operation and tweak it as data changes instead of running the expensive operation all over again.

Inheritors

Properties

Link copied to clipboard

Dependencies of the computation. Mapping of keys to the paths this computation depends on. Keys can be used within a ComputationContext to access the value of the dependencies.

Link copied to clipboard

Set of external context dependencies of the computation.

Link copied to clipboard
abstract val observers: List<Observer<Any?, TState>>

List of observers.

Functions

Link copied to clipboard
abstract suspend fun destroyState(state: TState)

Destroys the computation's state.

Link copied to clipboard
abstract suspend fun TContext.initState(): TState

Initialises and returns the computation's state, within a TContext containing the values of all declared dependencies.