scala-js / scala-js-dom

Statically typed DOM API for Scala.js
Other
315 stars 161 forks source link

Add `URLSearchParams` to `BodyInit` for fetch #634

Closed armanbilge closed 2 years ago

armanbilge commented 2 years ago

https://github.com/scala-js/scala-js-dom/blob/e7254c8a5729ee6a86b83111587522efa0955c31/dom/src/main/scala/org/scalajs/dom/package.scala#L35

zetashift commented 2 years ago

Shouldn't the scaladoc comment for BodyInit point to https://fetch.spec.whatwg.org/#bodyinit-unions ? At the very least the current link links to the ToC of the spec hehe.

Also is this issue really as easy as just adding URLSearchParams to the union?

armanbilge commented 2 years ago

Thanks, that seems better :)

Also is this issue really as easy as just adding URLSearchParams to the union?

Famous last words 😝 it should be, but I haven't checked if URLSearchParams exists at least 😂

zetashift commented 2 years ago

Yea if it didn't exist I'd be worried, but: https://github.com/scala-js/scala-js-dom/blob/51a807cc04ea134ece030d6d4005a8ce30c1de99/dom/src/main/scala/org/scalajs/dom/URLSearchParams.scala