Panda
- Package
- purescript-panda
- Repository
- i-am-tom/purescript-panda
#runApplication Source
runApplication :: forall event state update eff. Application (FX eff) update state event -> Eff (FX eff) (Maybe (EventSystem (FX eff) update state event))
Run a Panda application. This takes a Panda application and appends it to
the document.body
, effectively commandeering the entire page. If this
isn't what you want, chances are that you're after runApplicationIn
,
which will allow you to embed a Panda application inside the DOM. Note
that this function returns a Maybe
, depending on the presence of body
,
so this result should be checked to determine whether instantiation was
successful.
Re-exports from Panda.Internal.Types
#Property Source
data Property update state event
Properties are either static key/value pairs, listeners for DOM updates
(that can then change the properties on an element), or producers of
events (that then bubble up to the update
function).
#Component Source
data Component eff update state event
A component is either a delegate (embedded sub-application), element (with properties and children and an HTML representation), or just some text.
#Application Source
type Application eff update state event = { initial :: { state :: state, update :: update }, subscription :: Event event, update :: Updater eff update state event, view :: Component eff update state event }
A Panda application is a view (written in the component DSL) that is interpreted into an element (to be attached to the DOM), an event stream (that is merged with the subscription) that feeds into the update function, that update function (which produces updates for the view), and intiial state and update.