Module

Flame.Application

Package
purescript-flame-lynx
Repository
easafe/purescript-flame-lynx

#Update Source

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

#Application Source

type Application model message = { model :: model, subscribe :: Array (Subscription message), update :: Update model message, view :: model -> Html message }

Application contains

  • model – starting model
  • view – a function to update your markup
  • update – a function to update your model
  • subscribe – list of external events

#Route Source

newtype Route

Allows a "dynamic" application list

#makeRoute Source

makeRoute :: forall model message id. Show id => AppId id message -> Application model message -> Route

#makeGuardedRoute Source

makeGuardedRoute :: forall model message id targetId targetMessage. Show id => Show targetId => AppId id message -> Application model message -> Effect (Maybe (AppId targetId targetMessage)) -> Route

Redirect when the guard returns a different app ID; otherwise show the route

#mountRoutes Source

mountRoutes :: Array Route -> Effect Unit

Mount a Flame application with routing

#navigate Source

navigate :: forall id message. Show id => AppId id message -> Effect Unit

Navigate to a mounted application's route

#noMessages Source

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

#mount Source

mount :: forall id model message. Show id => AppId id message -> Application model message -> Effect Unit

Mount a Flame application that can be fed arbitrary external messages