Skip to content

purescript-halogen/purescript-halogen-virtual-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-halogen-virtual-dom

Latest release Build status

A virtual-dom driver for Halogen.

Installation

bower install purescript-halogen-virtual-dom

⚠️ Note ⚠️

You will also need to add virtual-dom as an NPM dependency to your project, and then use webpack or browserify to bundle it as part of the resulting JS file. If you're building with pulp then this is easy to do with the pulp browserify command.

Documentation

The main function of interest is Halogen.VirtualDOM.Driver.runUI. A minimal example of its usage:

module Main where

import Prelude
import Control.Monad.Eff (Eff)
import Halogen.Aff as HA
import Halogen.VirtualDOM.Driver (runUI)

main :: Eff (HA.HalogenEffects _) Unit
main = HA.runHalogenAff do
  body <- HA.awaitBody
  runUI ?myComponent ?initialInput body

Module documentation is published on Pursuit.