Package

purescript-elmish-html

Repository
collegevine/purescript-elmish-html
License
MIT
Uploaded by
fsoikin
Published on
2019-06-20

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"
    ]