Module

Panda.Property

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

#Producer Source

type Producer input = forall event state update. (input -> Maybe event) -> Property update state event

Event producers

#StaticProperty Source

type StaticProperty = forall event state update. Property update state event

Static properties are those whose update state event triple can be anything.

#eventToDragEvent Source

eventToDragEvent :: Event -> DragEvent

Event conversions

#eventToErrorEvent Source

#eventToFocusEvent Source

#eventToInputEvent Source

#eventToMouseEvent Source

#eventToTouchEvent Source

#eventToWheelEvent Source

#makeProducer Source

makeProducer :: forall input. Producer -> (Event -> input) -> Producer input

Specifically build a producer of a given input type.

#makeProducer' Source

makeProducer' :: forall event state update. Producer -> (Event -> Maybe event) -> Property update state event

Make a producer with the given handler.

#targetValue Source

targetValue :: forall event. (String -> Maybe event) -> Event -> Maybe event

Get the value of the target DOM element.

Re-exports from Panda.Property.Watchers

#Renderer Source

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

#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.

#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

#watchFor Source

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

Watch for a particular update.

#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...

#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.