This module allows you to make API calls to fetch an article and decode it into an Elm records.
Fetch an article by article's ID.
foremApiConfig : ForemApi.Config
foremApiConfig =
ForemApi.Config
"https://dev.to"
[ Http.header "accept" "application/vnd.forem.api-v1+json" ]
cmd : Cmd msg
cmd =
ForemApi.Article.fetch foremApiConfig 1208487 msgFetch an article using author's username and article's unique slug.
foremApiConfig : ForemApi.Config
foremApiConfig =
ForemApi.Config
"https://dev.to"
[ Http.header "accept" "application/vnd.forem.api-v1+json" ]
cmd : Cmd msg
cmd =
ForemApi.Article.fetchBySlug foremApiConfig "no_81" "1st-post-2a1" msgDecoder to decode article data from Forem Api into an Article record.
Representation of an Article record from Forem API. All functions in this module should return an Article record.