Module

FocusUI

Package
purescript-focus-ui
Repository
mbid/purescript-focus-ui

#StateRenderer Source

type StateRenderer s m = s -> MonadStateV s m -> Markup (Event -> m Unit)

A renderer of some state s into Markup, with stateful actions running in monad m.

#embed Source

embed :: forall m t s. Monad m => Lens' s t -> StateRenderer t m -> StateRenderer s m

Turn a renderer of a t into a renderer of an s via a Lens' from s to t, ignoring all information contained in an s that is not present in t.

#patchRepeatedly Source

patchRepeatedly :: forall e s. Node -> s -> StateRenderer s (Eff (dom :: DOM, ref :: REF | e)) -> Eff (dom :: DOM, ref :: REF | e) Unit

patchRepeatedly node initialState renderer: Render initialState via renderer into node and update the interface whenever the state changes.