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

Description

 
Synopsis

Events

onOffsetWith :: (ScrollCoordinatorOffsetEvent -> DOMRef -> action) -> Attribute model action Source #

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

onOffsetMain :: (ScrollCoordinatorOffsetEvent -> action) -> EventHandler model action Source #

Like onOffset, 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 ScrollCoordinatorOffsetEvent

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

onOffsetMainWith :: (ScrollCoordinatorOffsetEvent -> model -> DOMRef -> action) -> EventHandler model action Source #

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

data Action = Offset ScrollCoordinatorOffsetEvent Model DOMRef

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

Types

Decoders

Event Map