formula-one icon indicating copy to clipboard operation
formula-one copied to clipboard

Improve onSubmit parameter types

Open dmnd opened this issue 6 years ago • 0 comments
trafficstars

Consider changing onSubmit's arguments to (FormulaOneResult<T>, ExtraSubmitData) , where:

type FormulaOneResult<T> =
  | {
    valid: true,
    value: T
  }
  | {
    valid: false,
    internalValid: boolean, // or clientValid, if we don't want to change the name
    externalValid: boolean,
    invalidValue: T
  };

dmnd avatar Aug 15 '19 06:08 dmnd