| Copyright | (C) 2016-2026 David M. Johnson |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.Native.Element.Frame.Event
Description
Synopsis
- onLoad :: (FrameLoadEvent -> action) -> Attribute model action
- onLoadWith :: (FrameLoadEvent -> DOMRef -> action) -> Attribute model action
- onLoadMain :: (FrameLoadEvent -> action) -> EventHandler model action
- onLoadMainWith :: (FrameLoadEvent -> model -> DOMRef -> action) -> EventHandler model action
- onLoadMetrics :: (FrameLoadMetricsEvent -> action) -> Attribute model action
- onLoadMetricsWith :: (FrameLoadMetricsEvent -> DOMRef -> action) -> Attribute model action
- onLoadMetricsMain :: (FrameLoadMetricsEvent -> action) -> EventHandler model action
- onLoadMetricsMainWith :: (FrameLoadMetricsEvent -> model -> DOMRef -> action) -> EventHandler model action
- data FrameLoadEvent = FrameLoadEvent {}
- data FrameLoadMetricsEvent = FrameLoadMetricsEvent {}
- frameLoadDecoder :: Decoder FrameLoadEvent
- frameLoadMetricsDecoder :: Decoder FrameLoadMetricsEvent
- frameEvents :: Events
Events
onLoad :: (FrameLoadEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/frame.html#bindload
data Action = HandleLoad FrameLoadEvent view :: context -> props -> Model -> View context Action view _ _ model = frame_ [ src_ "http://url", onLoad HandleLoad ] [] update :: Action -> Effect props Model Action update (HandleLoad FrameLoadEvent {..}) = io_ (consoleLog "frame load event received")
onLoadWith :: (FrameLoadEvent -> DOMRef -> action) -> Attribute model action Source #
onLoadMain :: (FrameLoadEvent -> 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 = HandleLoad FrameLoadEvent view_ [ event (static (onLoadMain HandleLoad)) ] [ "some view" ]
onLoadMainWith :: (FrameLoadEvent -> 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 = HandleLoad FrameLoadEvent Model DOMRef view_ [ event (static (onLoadMainWith HandleLoad)) ] [ "some view" ]
onLoadMetrics :: (FrameLoadMetricsEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/frame.html#bindloadmetrics
data Action = HandleMetrics FrameLoadMetricsEvent view :: context -> props -> Model -> View context Action view _ _ model = frame_ [ src_ "http://url", onLoadMetrics HandleMetrics ] [] update :: Action -> Effect props Model Action update (HandleMetrics FrameLoadMetricsEvent {..}) = io_ (consoleLog "frame load metrics event received")
onLoadMetricsWith :: (FrameLoadMetricsEvent -> DOMRef -> action) -> Attribute model action Source #
Like onLoadMetrics, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onLoadMetricsMain :: (FrameLoadMetricsEvent -> action) -> EventHandler model action Source #
Like onLoadMetrics, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = HandleMetrics FrameLoadMetricsEvent view_ [ event (static (onLoadMetricsMain HandleMetrics)) ] [ "some view" ]
onLoadMetricsMainWith :: (FrameLoadMetricsEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onLoadMetricsMain, but the handler also receives read-only access to
the model and the target element's DOMRef (for imperative MTS mutation).
data Action = HandleMetrics FrameLoadMetricsEvent Model DOMRef view_ [ event (static (onLoadMetricsMainWith HandleMetrics)) ] [ "some view" ]
Types
data FrameLoadEvent Source #
https://lynxjs.org/api/elements/built-in/frame.html#bindload
Triggered when the embedded <frame> page finishes loading.
Constructors
| FrameLoadEvent | |
Fields
| |
Instances
| Show FrameLoadEvent Source # | |
Defined in Miso.Native.Element.Frame.Event Methods showsPrec :: Int -> FrameLoadEvent -> ShowS # show :: FrameLoadEvent -> String # showList :: [FrameLoadEvent] -> ShowS # | |
| Eq FrameLoadEvent Source # | |
Defined in Miso.Native.Element.Frame.Event Methods (==) :: FrameLoadEvent -> FrameLoadEvent -> Bool # (/=) :: FrameLoadEvent -> FrameLoadEvent -> Bool # | |
data FrameLoadMetricsEvent Source #
https://lynxjs.org/api/elements/built-in/frame.html#bindloadmetrics
Triggered with performance metrics for the embedded <frame> page load.
Constructors
| FrameLoadMetricsEvent | |
Fields
| |
Instances
| Show FrameLoadMetricsEvent Source # | |
Defined in Miso.Native.Element.Frame.Event Methods showsPrec :: Int -> FrameLoadMetricsEvent -> ShowS # show :: FrameLoadMetricsEvent -> String # showList :: [FrameLoadMetricsEvent] -> ShowS # | |
| Eq FrameLoadMetricsEvent Source # | |
Defined in Miso.Native.Element.Frame.Event Methods (==) :: FrameLoadMetricsEvent -> FrameLoadMetricsEvent -> Bool # (/=) :: FrameLoadMetricsEvent -> FrameLoadMetricsEvent -> Bool # | |
Decoders
Event Map
frameEvents :: Events Source #