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.
#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.
#awaitBody Source
awaitBody :: Aff HTMLElement
Waits for the document to load and then finds the body
element.