Add a global psuedo-field.

This commit is contained in:
Dillon Kearns 2022-07-27 18:10:53 +02:00
parent 944b78bce4
commit bce99b7ea5

View File

@ -3,6 +3,7 @@ module Form.Validation exposing
, andMap, andThen, fail, fromMaybe, fromResult, map, map2, parseWithError, succeed, withError, withErrorIf, withFallback
, value, fieldName, fieldStatus
, map3, map4, map5, map6, map7, map8, map9
, global
)
{-|
@ -77,6 +78,16 @@ succeed parsed =
Validation Nothing Nothing ( Just parsed, Dict.empty )
{-| -}
global : Field error () Never
global =
Validation Nothing
(Just "$$global$$")
( Just ()
, Dict.empty
)
{-| -}
withFallback : parsed -> Validation error parsed named constraints -> Validation error parsed named constraints
withFallback parsed (Validation viewField name ( maybeParsed, errors )) =