Bernardoow/elm-alert-timer-message/1.0.1

AlertTimerMessage

Simple message alert library. Its functionality is to hide and show alerts. The module is given a time and an HTML structure then does the job. You can create css and pass the msg to display.

The model

type alias Model =
{ messages : Dict Int Message
, count : Int
}

The model is simple. It's have a dict with msg and counter of displayed msg.

The initial state

modelInit : Model

Empty model with counter 1

View

view : Model -> Html Msg

Msg

type Msg
= AddNewMessage Float (Html Msg)
| RemoveAlert Int

The type representing messages that are passed inside the Rating. Notice: AddNewMessage receive two params: Float will be time to display and Html Msg will be a html struture. Tip: Use Css to improve Html Msg.

Update

update : Msg -> Model -> ( Model, Cmd Msg )