This module allows you to make API calls to fetch a list of articles and decode it into an Elm records.
{ username : Maybe String
, page : Maybe Basics.Int
, perPage : Maybe Basics.Int
, tag : Maybe String
, tags : Maybe (List String)
, tagsExclude : Maybe (List String)
}
A set of predefined query parameters used to fetch a list of articles.
blankQueryParameters : QueryParameters
Helper method to generate a blank set of QueryParameters
fetch : ForemApi.Config -> QueryParameters -> (Result Http.Error (List ForemApi.Article.Article) -> msg) -> Platform.Cmd.Cmd msg
Fetch a list of articles using a set of predefined filters represented by query parameters.
foremApiConfig : ForemApi.Config
foremApiConfig =
ForemApi.Config
"https://dev.to"
[ Http.header "accept" "application/vnd.forem.api-v1+json" ]
queryParameters : QueryParamters
queryParameters =
blankQueryParamters
cmd : Cmd msg
cmd =
ForemApi.Articles.fetch
foremApiConfig
{ queryParameters | tag = "elm" }
msg