Module

Pha

Package
purescript-pha
Repository
gbagan/purescript-pha

#VDom Source

data VDom :: Type -> Type

Instances

#Prop Source

data Prop :: Type -> Type

#Sub Source

data Sub :: Type -> Type

#h Source

h :: forall msg. String -> Array (Prop msg) -> Array (VDom msg) -> VDom msg

h tag attributes children

#text Source

text :: forall msg. String -> VDom msg

create a text virtual node

#emptyNode Source

emptyNode :: forall msg. VDom msg

represent an empty virtual node

does not generate HTML content. Only used for commodity

#key Source

key :: forall msg. String -> Prop msg

add a key to the vnode

#attr Source

attr :: forall msg. String -> String -> Prop msg

add or change an attribute

#style Source

style :: forall msg. String -> String -> Prop msg

add or change a style attribute

#on_ Source

on_ :: forall msg. String -> (Event -> Maybe msg) -> Prop msg

#class_ Source

class_ :: forall msg. String -> Prop msg

add a class name to the vnode

#class' Source

class' :: forall msg. String -> Boolean -> Prop msg

add a class name to the vnode if the second argument is true

#memo Source

memo :: forall msg a. a -> (a -> VDom msg) -> VDom msg

lazily generate a virtual dom

i.e. generate only if the first argument has changed. otherwise, return the previous generated virtual dom

#when Source

when :: forall msg. Boolean -> (Unit -> VDom msg) -> VDom msg
when true = vdom unit
when false = emptyNode

#(<&&>) Source

Operator alias for Pha.when (non-associative / precedence 1)

#maybeN Source

maybeN :: forall msg. Maybe (VDom msg) -> VDom msg
maybeN (Just vdom) = vdom
maybeN Nothing = emptyNode

#maybe Source

maybe :: forall msg a. Maybe a -> (a -> VDom msg) -> VDom msg

#(<??>) Source

Operator alias for Pha.maybe (non-associative / precedence 1)

#unsafeOnWithEffect Source

unsafeOnWithEffect :: forall msg. String -> EventHandler msg -> Prop msg

#EventHandler Source

type EventHandler msg = Event -> { effect :: Effect Unit, msg :: Maybe msg }

the effect can be stopPropagation, preventDefault, releasePointerCapture, etc...

Re-exports from Data.Tuple.Nested

#(/\) Source

Operator alias for Data.Tuple.Tuple (right-associative / precedence 6)

Shorthand for constructing n-tuples as nested pairs. a /\ b /\ c /\ d /\ unit becomes Tuple a (Tuple b (Tuple c (Tuple d unit)))

Re-exports from Pha.Update

#Update Source

type Update st effs = Run (state :: STATE st | effs) Unit

Re-exports from Web.Event.Event

#Event Source

data Event :: Type

Basic type for all DOM events.