Module

Flame.Application.EffectList

Package
purescript-flame
Repository
easafe/purescript-flame

The Elm like way to run a Flame application

The update function returns an array of side effects

#ListUpdate Source

type ListUpdate model message = model -> message -> Tuple model (Array (Aff (Maybe message)))

#Application Source

type Application model message = App model message (init :: Tuple model (Array (Aff (Maybe message))), update :: ListUpdate model message)

Application contains

  • init – the initial model and a list of messages to invoke update with
  • view – a function to update your markup
  • update – a function to update your model

#noMessages Source

noMessages :: forall model message. model -> Tuple model (Array (Aff (Maybe message)))

#mount Source

mount :: forall model message. QuerySelector -> Application model message -> Effect (Channel (Array message))

Mount a Flame application on the given selector

#mount_ Source

mount_ :: forall model message. QuerySelector -> Application model message -> Effect Unit

Mount a Flame application on the given selector, discarding the message Channel

#ResumedApplication Source

type ResumedApplication model message = App model message (init :: Array (Aff (Maybe message)), update :: ListUpdate model message)

ResumedApplication contains

  • init – initial list of messages to invoke update with
  • view – a function to update your markup
  • update – a function to update your model

#resumeMount Source

resumeMount :: forall model message. UnserializeModel model => QuerySelector -> ResumedApplication model message -> Effect (Channel (Array message))

Mount a Flame application on the given selector which was rendered server-side

#resumeMount_ Source

resumeMount_ :: forall model message. UnserializeModel model => QuerySelector -> ResumedApplication model message -> Effect Unit

Mount a Flame application on the given selector which was rendered server-side, discarding the message Channel