Module

Freedom.VNode

Package
purescript-freedom
Repository
purescript-freedom/purescript-freedom

#VObject Source

type VObject f state m = { children :: Array (VNode f state), didCreate :: Element -> FreeT (f state) m Unit, didDelete :: Element -> FreeT (f state) m Unit, didUpdate :: Element -> FreeT (f state) m Unit, handlers :: Object (Event -> FreeT (f state) m Unit), props :: Object String, tag :: String }

The representation for Element and OperativeElement

#VElement Source

data VElement f state

The type of virtual elements

  • Text: Just a text content
  • Element: Render as DOM Element like div, p and so on
  • OperativeElement: Render as DOM Element but is not rendered children of it automatically

Constructors

#VNode Source

data VNode f state

The type of virtual node. This has key and VElement

Constructors

#BridgeFoot Source

newtype BridgeFoot f state

The type for bridging rendering history from previous element to next element.

#createBridgeFoot Source

createBridgeFoot :: forall state f. Unit -> BridgeFoot f state

This is for internal. Do not use it.

#bridge Source

bridge :: forall state f. BridgeFoot f state -> BridgeFoot f state -> Effect Unit

This is for internal. Do not use it.

#fromBridgeFoot Source

fromBridgeFoot :: forall state f. BridgeFoot f state -> Effect (Ref (Array (Array (VNode f state))))

This is for internal. Do not use it.

#Operations Source

type Operations f state = { getLatestRenderedChildren :: Effect (Array (VNode f state)), getOriginChildren :: Effect (Array (VNode f state)), renderChildren :: Node -> Array (VNode f state) -> Effect Unit }

Operations for rendering children by OperativeElement

  • getOriginChildren: Get children passed with kids of OperativeElement
  • getLatestRenderedChildren: Get children already rendered
  • renderChildren: Patch passed children with previous rendered children

#VRenderEnv Source

newtype VRenderEnv f state

This is for internal. Do not use it.

Constructors

Instances

#VRender Source

newtype VRender f state a

Monad for event handlers and lifecycles for OperativeElement

Instances

#operations Source

operations :: forall state f. VRender f state (Operations f state)

Get operations

#runVRender Source

runVRender :: forall a state f. VRender f state a -> VRenderEnv f state -> Aff a

This is for internal. Do not use it.