Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. module Comp.FormData exposing (..)
  2.  
  3. type FormMessage u s
  4. = UpdateForm u
  5. | SubmitForm s
  6. | ResetForm
  7.  
  8. type FieldStatus valid invalid
  9. = FieldIsIncomplete
  10. | FieldIsValid valid
  11. | FieldIsInvalid invalid
  12.  
  13. type FormStatus valid invalid success error
  14. = FormFilling (FormFill valid invalid)
  15. | FormSubmitting (FormSubmission success error)
  16.  
  17. type FormFill valid invalid
  18. = FormIsIncomplete
  19. | FormIsValid valid
  20. | FormIsInvalid invalid
  21.  
  22. type FormSubmission success error
  23. = FormWorking
  24. | FormSuccess success
  25. | FormError error
  26.  
  27. type alias FormField t valid invalid =
  28. { value : t
  29. , message : FieldStatus valid invalid
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement