Module

Gesso

Package
purescript-gesso
Repository
smilack/purescript-gesso

This is the main entry point for Gesso applications and contains functions for running Aff values. For a full-page application where Gesso is the root component, typical usage of this module would be:

main :: Effect Unit
main = Gesso.launch appSpec

Or to confine Gesso to an element on the page, use launchIn with a query selector:

main :: Effect Unit
main = Gesso.launchIn "#some-element-id" appSpec

If it's necessary to perform other Aff actions, the run function is available:

runGessoAff do
  body <- awaitBody
  Gesso.run appSpec body

When Gesso is a subcomponent of another Halogen component, run Halogen and include Gesso as a child component in the standard way.

#launch Source

launch :: forall state input ouput. AppSpec state input ouput -> Effect Unit

Launch a Gesso application in the page body.

#launchIn Source

launchIn :: forall state input ouput. String -> AppSpec state input ouput -> Effect Unit

Launch a Gesso application in a given element. The String argument should be a valid query selector for some element on the page.

#run Source

run :: forall state input ouput. AppSpec state input ouput -> HTMLElement -> Aff Unit

An Aff which starts a Gesso application in the provided element. Used when performing other Aff effects at the same time as running the application.

#runGessoAff Source

runGessoAff :: forall x. Aff x -> Effect Unit

Run an Aff value such as the one produced by run. Alias for Halogen.Aff.runHalogenAff.

Re-exports from Halogen.Aff

#selectElement Source

selectElement :: QuerySelector -> Aff (Maybe HTMLElement)

Tries to find an element in the document.

#awaitLoad Source

awaitLoad :: Aff Unit

Waits for the document to load.

#awaitBody Source

awaitBody :: Aff HTMLElement

Waits for the document to load and then finds the body element.

Re-exports from Web.DOM.ParentNode