Module

Panda.HTML

Package
purescript-panda
Repository
i-am-tom/purescript-panda

#delegate Source

delegate :: forall subevent event substate state subupdate update eff. { event :: subevent -> Maybe event, state :: state -> substate, update :: update -> Maybe subupdate } -> Application eff subupdate substate subevent -> Component eff update state event

Wrap an application within a component such that it can be embedded within a larger application.

Re-exports from Panda.HTML.Elements

#StaticElementWithoutProperties Source

type StaticElementWithoutProperties = forall event state update eff. Array (Component eff update state event) -> Component eff update state event

An element with no specified properties and fixed children.

#StaticElement Source

type StaticElement = forall event state update eff. Array (Property update state event) -> Array (Component eff update state event) -> Component eff update state event

An element whose immediate children definitely don't respond to updates.

#SelfClosingElementWithoutProperties Source

type SelfClosingElementWithoutProperties = forall event state update eff. Component eff update state event

A non-container element that has no custom properties.

#SelfClosingElement Source

type SelfClosingElement = forall event state update eff. Array (Property update state event) -> Component eff update state event

An element that, according to the HTML spec, is not a container.

#ElementWithoutProperties Source

type ElementWithoutProperties = forall event state update eff. Children eff update state event -> Component eff update state event

An element with no specified properties.

#Element Source

type Element = forall event state update eff. Array (Property update state event) -> Children eff update state event -> Component eff update state event

A regular element.

#text Source

text :: forall event state update eff. String -> Component eff update state event

Re-exports from Panda.HTML.Watchers

#renderMaybe Source

renderMaybe :: forall value event state update eff. ({ state :: state, update :: update } -> Maybe value) -> (value -> Component eff update state event) -> Children eff update state event

Given an update and state, maybe produce a value. If a value is produced, use this value to render a component. As with the other render methods, this will trigger a full re-render.

#renderAlways' Source

renderAlways' :: forall event state update eff. (state -> Component eff update state event) -> Children eff update state event

Regardless of the update, re-render with no interest in what the update was. Again, this will be a real performance-killer in larger applications, so use it with caution. Beyond very simple cases, it's usually a sign that something needs rethinking.

#renderAlways Source

renderAlways :: forall event state update eff. ({ state :: state, update :: update } -> Component eff update state event) -> Children eff update state event

Regardless of the update, re-render this child. NB that this is probably a bad idea within a larger application, as it will probably equate to a lot of unnecessary re-render. Consider embedding such an element within a delegate and filtering updates to improve performance.