cached method

CachedFormix<T, E> cached()

Wraps this validator with single-value caching.

Returns the cached result if the input value hasn't changed, avoiding redundant validation computations.

final cached = emailRule.cached();

cached.validate('test@example.com'); // Computed
cached.validate('test@example.com'); // Cached!
cached.validate('other@example.com'); // Computed

This is ideal for form fields that validate on every keystroke.

Note: Returns a CachedFormix instance with mutable state.

Implementation

CachedFormix<T, E> cached() => CachedFormix(this);