Observer

open class Observer<T, TState>(val toObserve: Path, val updateState: UpdateStateFn<T, TState>)(source)

Observer used within a stateful computation.

Defines a path to observe and a function to update the state of the computation whenever an event with a path matching the one being observed occurs.

Constructors

Link copied to clipboard
constructor(toObserve: Path, updateState: UpdateStateFn<T, TState>)

Properties

Link copied to clipboard

Path to observe.

Link copied to clipboard

Updates the computation's state given the previous state and the event whose path matches the path being observed.