| 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.X.Element.Viewpager.Event
Description
Synopsis
- onChange :: (ViewpagerChangeEvent -> action) -> Attribute model action
- onChangeWith :: (ViewpagerChangeEvent -> DOMRef -> action) -> Attribute model action
- onChangeMain :: (ViewpagerChangeEvent -> action) -> EventHandler model action
- onChangeMainWith :: (ViewpagerChangeEvent -> model -> DOMRef -> action) -> EventHandler model action
- onOffsetChange :: (Double -> action) -> Attribute model action
- onOffsetChangeWith :: (Double -> DOMRef -> action) -> Attribute model action
- onOffsetChangeMain :: (Double -> action) -> EventHandler model action
- onOffsetChangeMainWith :: (Double -> model -> DOMRef -> action) -> EventHandler model action
- onWillChange :: (ViewpagerChangeEvent -> action) -> Attribute model action
- onWillChangeWith :: (ViewpagerChangeEvent -> DOMRef -> action) -> Attribute model action
- onWillChangeMain :: (ViewpagerChangeEvent -> action) -> EventHandler model action
- onWillChangeMainWith :: (ViewpagerChangeEvent -> model -> DOMRef -> action) -> EventHandler model action
- data ViewpagerChangeEvent = ViewpagerChangeEvent {}
- viewpagerChangeDecoder :: Decoder ViewpagerChangeEvent
- offsetChangeDecoder :: Decoder Double
- viewpagerEvents :: Events
Events
onChange :: (ViewpagerChangeEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/viewpager.html#bindchange
Triggered with the current page index after the transition completes.
onChangeWith :: (ViewpagerChangeEvent -> DOMRef -> action) -> Attribute model action Source #
onChangeMain :: (ViewpagerChangeEvent -> action) -> EventHandler model action Source #
Like onChange, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = Changed ViewpagerChangeEvent view_ [ event (static (onChangeMain Changed)) ] [ "some view" ]
onChangeMainWith :: (ViewpagerChangeEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onChangeMain, but the handler also receives read-only access to the
model and the target element's DOMRef (for imperative MTS mutation).
data Action = Changed ViewpagerChangeEvent Model DOMRef view_ [ event (static (onChangeMainWith Changed)) ] [ "some view" ]
onOffsetChange :: (Double -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/viewpager.html#bindoffsetchange
Triggered with the scrolling progress during a page transition.
onOffsetChangeWith :: (Double -> DOMRef -> action) -> Attribute model action Source #
Like onOffsetChange, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onOffsetChangeMain :: (Double -> action) -> EventHandler model action Source #
Like onOffsetChange, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = OffsetChanged Double view_ [ event (static (onOffsetChangeMain OffsetChanged)) ] [ "some view" ]
onOffsetChangeMainWith :: (Double -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onOffsetChangeMain, but the handler also receives read-only access to
the model and the target element's DOMRef (for imperative MTS mutation).
data Action = OffsetChanged Double Model DOMRef view_ [ event (static (onOffsetChangeMainWith OffsetChanged)) ] [ "some view" ]
onWillChange :: (ViewpagerChangeEvent -> action) -> Attribute model action Source #
https://lynxjs.org/api/elements/built-in/viewpager.html#bindwillchange
Triggered with the next page index before the transition starts.
onWillChangeWith :: (ViewpagerChangeEvent -> DOMRef -> action) -> Attribute model action Source #
Like onWillChange, but the handler also receives the target element's DOMRef.
Use for main-thread (MTS) handlers that imperatively mutate the element.
onWillChangeMain :: (ViewpagerChangeEvent -> action) -> EventHandler model action Source #
Like onWillChange, but dispatched on the Lynx main thread (MTS).
Runs imperatively on the MTS (no VDOM diff). Meant to be used with
-XStaticPointers.
data Action = WillChange ViewpagerChangeEvent view_ [ event (static (onWillChangeMain WillChange)) ] [ "some view" ]
onWillChangeMainWith :: (ViewpagerChangeEvent -> model -> DOMRef -> action) -> EventHandler model action Source #
Like onWillChangeMain, but the handler also receives read-only access to
the model and the target element's DOMRef (for imperative MTS mutation).
data Action = WillChange ViewpagerChangeEvent Model DOMRef view_ [ event (static (onWillChangeMainWith WillChange)) ] [ "some view" ]
Types
data ViewpagerChangeEvent Source #
Payload of the bindchange and bindwillchange events.
Constructors
| ViewpagerChangeEvent | |
Instances
| Show ViewpagerChangeEvent Source # | |
Defined in Miso.Native.X.Element.Viewpager.Event Methods showsPrec :: Int -> ViewpagerChangeEvent -> ShowS # show :: ViewpagerChangeEvent -> String # showList :: [ViewpagerChangeEvent] -> ShowS # | |
| Eq ViewpagerChangeEvent Source # | |
Defined in Miso.Native.X.Element.Viewpager.Event Methods (==) :: ViewpagerChangeEvent -> ViewpagerChangeEvent -> Bool # (/=) :: ViewpagerChangeEvent -> ViewpagerChangeEvent -> Bool # | |