Interface InputOptions

Describes options customizing an input UI state.

Type parameters

Type parameter Description
TValue

the input's value type

name

name: undefined | string

Debug-friendly name that can be back-queried from the state instance.

normalizer

normalizer: undefined | function

Specifies how the input value should be normalized before it gets parsed into a domain value. You can use this hook to e.g. remove extra spaces from inputs or converting separating characters into a standardized form.

Unlike parsing, normalization should never fail: At worst case the input value should be returned as is.

param

input value to normalize

revalidate

revalidate: undefined | function

specifies if an input should re-validate on confirm. This defaults to true if the two values are the same.

param

the current input value to confirm

param

the previously confirmed input value

confirmCascade

  • confirmCascade(this: Input<TValue>, value: TValue, self: Input<TValue>): void
  • Specifies how confirming this input will synchronously confirm the other inputs.

    Using cascading over separate confirm() calls make sure that domain validation depending on either or both inputs are triggered in the same validation cycle.

    If using an arrow function, the input itself is given back as second argument for convenience.

    Parameters

    • this: Input<TValue>
    • value: TValue

      The input value to confirm.

    • self: Input<TValue>

      Handy reference to the input itself.

    Returns void

Generated using TypeDoc