All Downloads are FREE. Search and download functionalities are using the official Maven repository.

elm.recordEncoder.mustache Maven / Gradle / Ivy

encode : {{classname}} -> Encode.Value
encode =
    Encode.object << encodePairs


encodeWithTag : ( String, String ) -> {{classname}} -> Encode.Value
encodeWithTag (tagField, tag) model =
    Encode.object <| encodePairs model ++ [ ( tagField, Encode.string tag ) ]


encodePairs : {{classname}} -> List (String, Encode.Value)
encodePairs model =
{{#allVars}}
    {{#-first}}[{{/-first}}{{^-first}},{{/-first}} {{>recordFieldEncoder}}
{{/allVars}}
    ]




© 2015 - 2024 Weber Informatics LLC | Privacy Policy