Module

Panda.Property.Watchers

Package
purescript-panda
Repository
i-am-tom/purescript-panda

#Renderer Source

type Renderer update state event = { state :: state, update :: update } -> Array PropertyUpdate

#watch Source

watch :: forall event state update. ({ state :: state, update :: update } -> Array PropertyUpdate) -> Property update state event

General constructor for property watches. Kind of the "advanced mode" - use the other functions if possible.

#watchAny Source

watchAny :: forall event state update. Renderer update state event -> Property update state event

Run a property update regardless of the update that is detected. For larger applications, this will happen very regularly, so be careful with this...

#watchFor Source

watchFor :: forall event state update. Eq update => update -> Renderer update state event -> Property update state event

Watch for a particular update.

#watchSet Source

watchSet :: forall event state update. Array { match :: update -> Boolean, renderer :: Renderer update state event } -> Property update state event

Given a set of predicate/render pairs, update the property accordingly

#watchWhen Source

watchWhen :: forall event state update. ({ state :: state, update :: update } -> Boolean) -> Renderer update state event -> Property update state event

Update a property whenever a predicate is satisfied.