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

Description

 
Synopsis

Events

onHeaderOffset :: (HeaderOffsetEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/refresh.html#bindheaderoffset

Triggered during movement while the <refresh-header> is exposed.

onHeaderOffsetWith :: (HeaderOffsetEvent -> DOMRef -> action) -> Attribute model action Source #

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

onHeaderOffsetMain :: (HeaderOffsetEvent -> action) -> EventHandler model action Source #

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

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

data Action = Offset HeaderOffsetEvent

view_ [ event (static (onHeaderOffsetMain Offset)) ] [ "some view" ]

onHeaderOffsetMainWith :: (HeaderOffsetEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

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

data Action = Offset HeaderOffsetEvent Model DOMRef

view_ [ event (static (onHeaderOffsetMainWith Offset)) ] [ "some view" ]

onRefreshStateChangeWith :: (RefreshStateChangeEvent -> DOMRef -> action) -> Attribute model action Source #

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

onRefreshStateChangeMain :: (RefreshStateChangeEvent -> action) -> EventHandler model action Source #

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

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

data Action = StateChanged RefreshStateChangeEvent

view_ [ event (static (onRefreshStateChangeMain StateChanged)) ] [ "some view" ]

onRefreshStateChangeMainWith :: (RefreshStateChangeEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

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

data Action = StateChanged RefreshStateChangeEvent Model DOMRef

view_ [ event (static (onRefreshStateChangeMainWith StateChanged)) ] [ "some view" ]

onStartRefresh :: (StartRefreshEvent -> action) -> Attribute model action Source #

https://lynxjs.org/api/elements/built-in/refresh.html#bindstartrefresh

Triggered when the pull threshold is reached or autoStartRefresh is called.

onStartRefreshWith :: (StartRefreshEvent -> DOMRef -> action) -> Attribute model action Source #

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

onStartRefreshMain :: (StartRefreshEvent -> action) -> EventHandler model action Source #

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

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

data Action = Started StartRefreshEvent

view_ [ event (static (onStartRefreshMain Started)) ] [ "some view" ]

onStartRefreshMainWith :: (StartRefreshEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

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

data Action = Started StartRefreshEvent Model DOMRef

view_ [ event (static (onStartRefreshMainWith Started)) ] [ "some view" ]

Types

data HeaderOffsetEvent Source #

Payload of the bindheaderoffset event.

Constructors

HeaderOffsetEvent 

Fields

newtype RefreshStateChangeEvent Source #

Payload of the bindrefreshstatechange event.

Constructors

RefreshStateChangeEvent 

Fields

newtype StartRefreshEvent Source #

Payload of the bindstartrefresh event.

Constructors

StartRefreshEvent 

Fields

  • isManual :: Bool

    Whether the startrefresh event was triggered by a manual drag

Decoders

Event Map