OnChange

data class OnChange(val delay: Duration = DefaultDelayMs.milliseconds) : SaveBehavior

A saving behavior that saves the state when after it has changed. The newest state will be saved. (i.e. the state the store has after the delay has passed. The delay will be reset and previous state save job will be canceled if state changes again.

This effectively "throttles" the saving as the user changes the state.

When multiple OnChange are provided, the minimum delay across all of them will be used.

See also

Constructors

Link copied to clipboard
constructor(delay: Duration = DefaultDelayMs.milliseconds)

Properties

Link copied to clipboard