import Json.Decode as JD
import Json.Decode.Pipeline as JP
type PostType = Image | Video
type alias Post = {
id: Int
, postType: PostType
}
-- assuming server will send int value of 0 for Image or 1 for Video
decodePostType: JD.Decoder PostType
decodePostType =
JD.int |&...