purescript-elmish-html

Render HTML elements in Elmish


License
Other
Install
bower install purescript-elmish-html

Documentation

purescript-elmish-html

Render HTML elements in Elmish.

Example

Elmish.HTML lets you render HTML elements directly in PureScript:

import Elmish.HTML as R

view :: State -> DispatchMsgFn Message -> ReactElement
view state dispatch =
    R.div {}
    [ R.h1 {} "Counter"
    , R.text ("Count: " <> show state.count)
    , R.br {}
    , R.button { type: "button", onClick: handle dispatch Inc } "Inc"
    , R.button { type: "button", onClick: handle dispatch Dec } "Dec"
    ]