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
Enums currently are defined separately for Scala 2 and Scala 3,not only that these enums, are anonymous objects backed by string fields. Because scalajs-dom wants to stay as close as possible to the JavaScript Web API.
we use enums like this:
PredefinedColorSpace.`display-p3`
Object literals
These are anonymous objects in Scala 3:
ImageData(200, 100, new { colorSpace =PredefinedColorSpace.`display-p3` })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the objectliteral
They are not something like ImageSettings.apply(...) because of sjs-dom goal, stay as close as possible to the JS API.
Not clean, but we should documentate why it is like this, with some example, most likely adding this to CONTRIBUTING.md.
The text was updated successfully, but these errors were encountered:
Enums
Enums currently are defined separately for Scala 2 and Scala 3,not only that these enums, are anonymous objects backed by string fields. Because
scalajs-dom
wants to stay as close as possible to the JavaScript Web API.we use
enum
s like this:PredefinedColorSpace.`display-p3`
Object literals
These are anonymous objects in Scala 3:
They are not something like
ImageSettings.apply(...)
because ofsjs-dom
goal, stay as close as possible to the JS API.Not clean, but we should documentate why it is like this, with some example, most likely adding this to
CONTRIBUTING.md
.The text was updated successfully, but these errors were encountered: