Module

Grain.UI

Package
purescript-grain
Repository
purescript-grain/purescript-grain

#UI Source

newtype UI

The type of UI state.

#mountUI Source

mountUI :: VNode -> Node -> Effect UI

Mount a VNode to a parent node.

#patchUI Source

patchUI :: Maybe VNode -> UI -> Effect Unit

Patch a VNode of UI.

#VNode Source

data VNode

The type of virtual node.

Instances

#key Source

key :: String -> VNode -> VNode

Add a key to a VNode.

#fingerprint Source

fingerprint :: String -> VNode -> VNode

Add a fingerprint to check equality of a VNode.

If it is same as previous rendered element's one, rendering will be skipped.

#component Source

component :: Render VNode -> VNode

Create a VNode of component.

#element Source

element :: String -> VNode

Create a VNode of specified tag element.

#text Source

text :: String -> VNode

Create a VNode of text.

#kids Source

kids :: Array VNode -> VNode -> VNode

Add children.

#prop Source

prop :: String -> String -> VNode -> VNode

Add a property.

#handle Source

handle :: String -> (Event -> Effect Unit) -> VNode -> VNode

Bind an event handler.

#didCreate Source

didCreate :: (Element -> Effect Unit) -> VNode -> VNode

Bind didCreate lifecycle.

#didUpdate Source

didUpdate :: (Element -> Effect Unit) -> VNode -> VNode

Bind didUpdate lifecycle.

#didDelete Source

didDelete :: (Element -> Effect Unit) -> VNode -> VNode

Bind didDelete lifecycle.