Skip to content

Instantly share code, notes, and snippets.

@fponticelli
Created September 21, 2017 01:59
Show Gist options
  • Save fponticelli/665c05c0d5637a691d668c4643803013 to your computer and use it in GitHub Desktop.
Save fponticelli/665c05c0d5637a691d668c4643803013 to your computer and use it in GitHub Desktop.
module Comp.FormData exposing (..)
type FormMessage u s
= UpdateForm u
| SubmitForm s
| ResetForm
type FieldStatus valid invalid
= FieldIsIncomplete
| FieldIsValid valid
| FieldIsInvalid invalid
type FormStatus valid invalid success error
= FormFilling (FormFill valid invalid)
| FormSubmitting (FormSubmission success error)
type FormFill valid invalid
= FormIsIncomplete
| FormIsValid valid
| FormIsInvalid invalid
type FormSubmission success error
= FormWorking
| FormSuccess success
| FormError error
type alias FormField t valid invalid =
{ value : t
, message : FieldStatus valid invalid
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment