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.Viewpager.Event

Description

 
Synopsis

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 #

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

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 

Fields

Decoders

Event Map