You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exposing more of the event data allows the user more freedom.
Take for example the mouse events,mousemove, mousedown etc. Currently the coordinates of the event relative to the source element are passed to the user: e.pageX - offset.left and e.pageY - offset.top. By exposing e.pageX and offset.left as separate items the user has more information to work with, the previous information can still be constructed.
The code in lib.js would be simplified such that each event returns the same data to Haskell, some values might be null or undefined.
In Haskell we would then convert from JSON to an event information data type:
data EventInfo = EventInfo {
ePageX :: Maybe Int
, ePageY :: Maybe Int
, eOffsetLeft :: Maybe Int
, eOffsetTop :: Maybe Int
, eWhich :: Maybe Int
, eValue :: Maybe String
}
An existing event function's API would not change:
Exposing more of the event data allows the user more freedom.
Take for example the mouse events,
mousemove
,mousedown
etc. Currently the coordinates of the event relative to the source element are passed to the user:e.pageX - offset.left
ande.pageY - offset.top
. By exposinge.pageX
andoffset.left
as separate items the user has more information to work with, the previous information can still be constructed.The code in
lib.js
would be simplified such that each event returns the same data to Haskell, some values might benull
orundefined
.In Haskell we would then convert from JSON to an event information data type:
An existing event function's API would not change:
However an additional function could expose more event information:
If there is support for this, I would be happy to work on it based on feedback 🎉
The text was updated successfully, but these errors were encountered: