/
OnMouseover.purs
29 lines (22 loc) · 919 Bytes
/
OnMouseover.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module Deku.DOM.Attr.OnMouseover where
import Prelude
import Effect (Effect)
import Deku.Attribute (class Attr, Attribute, Cb(..), cb', unsafeAttribute, unset')
import FRP.Event (Event)
data OnMouseover = OnMouseover
instance Attr anything OnMouseover Cb where
attr OnMouseover value = unsafeAttribute
{ key: "mouseover", value: cb' value }
instance Attr anything OnMouseover (Effect Unit) where
attr OnMouseover value = unsafeAttribute
{ key: "mouseover", value: cb' (Cb (const (value $> true))) }
instance Attr anything OnMouseover (Effect Boolean) where
attr OnMouseover value = unsafeAttribute
{ key: "mouseover", value: cb' (Cb (const value)) }
type OnMouseoverEffect =
forall element
. Attr element OnMouseover (Effect Unit)
=> Event (Attribute element)
instance Attr everything OnMouseover Unit where
attr OnMouseover _ = unsafeAttribute
{ key: "mouseover", value: unset' }