glazier-react-1.0.0.0: ReactJS binding using Glazier.Command.

Safe HaskellNone
LanguageHaskell2010

Glazier.React.Notice.Internal

Synopsis

Documentation

newtype Notice Source #

Every event in React is a synthetic event, a cross-browser wrapper around the native event. which reused from a pool. So it is dangerous to keep a reference to a Notice since it may expire and contain other things without you knowing. All relevant data from the Notice must be consumed as soon you get one. That is, Notice must only be used in the first part of handleEvent. It is not an instance of NFData and so cannot be returned into the second lazy part of handleEvent

Constructors

Notice JSRep 
Instances
Show Notice Source # 
Instance details

Defined in Glazier.React.Notice.Internal

Generic Notice Source # 
Instance details

Defined in Glazier.React.Notice.Internal

Associated Types

type Rep Notice :: * -> * #

Methods

from :: Notice -> Rep Notice x #

to :: Rep Notice x -> Notice #

FromJS Notice Source # 
Instance details

Defined in Glazier.React.Notice.Internal

Methods

fromJS :: JSVal -> Maybe Notice #

type Rep Notice Source # 
Instance details

Defined in Glazier.React.Notice.Internal

type Rep Notice = D1 (MetaData "Notice" "Glazier.React.Notice.Internal" "glazier-react-1.0.0.0-DAsVOnciJu1LqT93cng4yY" True) (C1 (MetaCons "Notice" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 JSRep)))

unsafeGetProperty :: PFromJSVal a => JSVal -> JSString -> a Source #

Within the strict part of handleEventM the Notice is effectively immutable. We want to maintain this lie so that we can lazily parse only the properties the event handler is interested in. This will throw if J.JSVal is null, or not convertible to the desired type so we are assuming that Notice will behave nicely.

unsafeGetModifierState :: JSVal -> JSString -> Bool Source #

See https://www.w3.org/TR/DOM-Level-3-Events-key/#keys-modifier This will throw if J.JSVal is null, but shouldn't happen since we've already check for a valid Notice