guard property

T Function(T current, T next)? guard
final

Value guard/transformer called before setting a new value.

Use this to validate, clamp, or transform values:

NeuronAtom<int>(
  50,
  guard: (current, next) => next.clamp(0, 100),
)

Implementation

final T Function(T current, T next)? guard;