Module

Dominator.Core.VirtualDom

Package
purescript-dominator-core
Repository
lazamar/purescript-dominator-core

#DOM Source

data DOM :: Effect

#Node Source

data Node msg

An immutable chunk of data representing a DOM node.

Instances

#Renderer Source

data Renderer

A Renderer takes care of dom and virtual dom updates

#text Source

text :: forall msg. String -> Node msg

Just put plain text in the DOM. It will escape the string so that it appears

#node Source

node :: forall msg. String -> Array (Property msg) -> Array (Node msg) -> Node msg

#Property Source

data Property msg

When using HTML and JS, there are two ways to specify parts of a DOM node.

Instances

#property Source

property :: forall msg. String -> Foreign -> Property msg

Create arbitrary properties.

#attribute Source

attribute :: forall msg. String -> String -> Property msg

Create arbitrary HTML attributes. Maps onto JavaScript’s setAttribute

#attributeNS Source

attributeNS :: forall msg. String -> String -> String -> Property msg

Would you believe that there is another way to do this?! This corresponds

#style Source

style :: forall msg. List (Tuple String String) -> Property msg

Specify a list of styles.

#on Source

on :: forall msg. String -> Decoder msg -> Property msg

Create a custom event listener.

#onWithOptions Source

onWithOptions :: forall msg. String -> Options -> Decoder msg -> Property msg

#Options Source

type Options = { preventDefault :: Boolean, stopPropagation :: Boolean }

Options for an event listener. If stopPropagation is true, it means the

#defaultOptions Source

defaultOptions :: Options

Everything is False by default.

#lazy Source

lazy :: forall msg a. (a -> Node msg) -> a -> Node msg

A performance optimization that delays the building of virtual DOM nodes.

#lazy2 Source

lazy2 :: forall msg b a. (a -> b -> Node msg) -> a -> b -> Node msg

Same as lazy but checks on two arguments.

#lazy3 Source

lazy3 :: forall msg c b a. (a -> b -> c -> Node msg) -> a -> b -> c -> Node msg

Same as lazy but checks on three arguments.

#keyedNode Source

keyedNode :: forall msg. String -> Array (Property msg) -> Array (Tuple String (Node msg)) -> Node msg