Module
Bonsai.Event
- Package
- purescript-bonsai
- Repository
- grmble/purescript-bonsai
Event listener utilities
For maximum performance, event handlers attached to the virtual DOM should be comparable by object identity. For this, you have call on with a top level function event decoder.
So for top VDOM diff/patching performance, instead of using onInput, you would make a top level function
decodeXxx event = eventDecoder Xxx targetValue
-- use it like on "input" decodeXxx
Or you might just have a single event handler on a parent element and look at the event target.
#onClickWithOptions Source
onClickWithOptions :: forall msg. Options -> msg -> Property msg
#targetValue Source
targetValue :: EventDecoder String
Read the value of the target input element
#targetValues Source
targetValues :: EventDecoder (StrMap String)
Read the names and values of target form, for form events.