Skip to content
This repository has been archived by the owner on Jun 24, 2018. It is now read-only.

ocharles/virtual-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

virtual-dom

This library provides Haskell (GHCJS) bindings to the virtual-dom project. virtual-dom is a set of Javascript libraries to allow one to build a functional representation of the browser DOM in a declarative manner, and efficiently render these changes into the DOM.

These bindings provide:

  • A lens interface to building elements and setting their attributes.
  • A lucid-like DSL for building HTML documents - with functions for all HTML 5 elements and attributes.
  • The ability to register hooks.
  • The ability to attach event handlers by using dom-delegator.

For a small example of how this library can be used, see below

{-# LANGUAGE OverloadedStrings #-}
import VirtualDom

main :: IO ()
main =
  do body <- bodyContainer
     initDomDelegator
     renderTo body
              (with body_
                    (on "click" (const (putStrLn "Ouch")))
                    [into h1_ ["Heading"]])

About

Haskell (GHCJS) bindings to the virtual-dom project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published