Comments (4)
Shouldn't it rather be
trait HashChangeEvent extends js.Object {
val newURL: String
val oldURL: String
}
?
from scala-js-dom.
What's the advantage of inheriting from js.Object
?
from scala-js-dom.
It's not a matter of advantage or disadvantage. If this represents a JavaScript object, it must inherit from js.Object
, otherwise things will just blow up. The compiler treats differently types extending js.Object
than those that do not.
See the doc about JavaScript interop.
Btw, it should even inherit from Event.
from scala-js-dom.
Ok, thanks for the information. I saw some Scala.JS code which used case classes in order to cast native objects to them. As this worked fine in my case, I thought that was the way to go.
By the way, I made a pull request with some additions a few weeks ago. Could you have a look at it?
from scala-js-dom.
Related Issues (20)
- `Location#origin` should return a `String` HOT 1
- Fetch `RequestInit` needs duplex attribute HOT 1
- Add `PageTransitionEvent` HOT 1
- Typo in "WriteableStream" trait name? HOT 1
- Recommended approach when `Response.type` is undefined? HOT 1
- `Element#id` returns undefined HOT 2
- Update available MIMEtypes HOT 5
- Use `XMLDocument` type when parsing XML string in `DOMParser` HOT 3
- Remove attributes class members from Node
- is changing `Array` -> `FrozenArray` binary compatible? HOT 4
- It looks we are missing some methods from the FormData class HOT 2
- Confusing type of ImageData.data HOT 3
- Create bindings for webgpu
- WebAudio classes
- LockOptions doesn't use val for fields, making overriding not possible HOT 2
- Constructor parameters for URLSearchParams are not quite right
- Clarify `enum` and `object literals` usage in `scalajs-dom`
- Return Type of HTMLCanvasElement getContext is not clear. HOT 1
- Support Int.Locale
- MediaQueryList.addListener has wrong type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-js-dom.