miso
Copyright(C) 2016-2026 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Native.X.Element.Svg.Event

Description

 
Synopsis

Events

onLoad :: action -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/svg.html#bindload

Triggered when the SVG finishes loading.

onLoadWith :: (DOMRef -> action) -> Attribute model action Source #

Like onLoad, but the handler also receives the target element's DOMRef. Use for main-thread (MTS) handlers that imperatively mutate the element.

onLoadMain :: action -> EventHandler model action Source #

Like onLoad, but dispatched on the Lynx main thread (MTS).

Runs imperatively on the MTS (no VDOM diff). Meant to be used with -XStaticPointers.

data Action = Loaded

view_ [ event (static (onLoadMain Loaded)) ] [ "some view" ]

onLoadMainWith :: (model -> DOMRef -> action) -> EventHandler model action Source #

Like onLoadMain, but the handler also receives read-only access to the model and the target element's DOMRef (for imperative MTS mutation).

data Action = Loaded Model DOMRef

view_ [ event (static (onLoadMainWith Loaded)) ] [ "some view" ]

Event Map