NoRedInk/elm-sweet-poll/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

SweetPoll

Configuration

type alias Config data =
{ url : String
, decoder : Decoder data
, delay : Time
, samesBeforeDelay : Int
, delayMultiplier : Float
, maxDelay : Time
}
defaultConfig : Decoder data -> String -> Config data

Default configuration for SweetPoll

Elm Artchitecture

type Model data

Private state of the SweetPoll component

type Action data
= PollSuccess data
| PollFailure Error
init : Config data -> ( Model data, Cmd (Action data) )
update : Action data -> Model data -> ( Model data, Cmd (Action data) )

The SweetPoll StartApp-style update function

Record Extension Component

type alias ComponentModel base data =
{ base | sweetPoll : Model data }

Model type for using the NoRedInk/elm-api-components pattern

Action data
-> ComponentModel base data
-> ( ComponentModel base data, Cmd (Action data) )

Update function for using the NoRedInk/elm-api-components pattern