Skip to content

Commit 69033d5

Browse files
committed
Deprecate the ext.Ajax extension.
Recommend to use `dom.fetch` instead, whose API is basically just as good as `Ajax` was.
1 parent 413f006 commit 69033d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/scala/org/scalajs/dom/ext/Extensions.scala

+6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ import org.scalajs.dom.{Blob, FormData}
1616
* Thrown when `Ajax.get` or `Ajax.post` receives a non-20X response code.
1717
* Contains the XMLHttpRequest that resulted in that response
1818
*/
19+
@deprecated("use the dom.fetch API instead", "2.0.0")
1920
case class AjaxException(xhr: dom.XMLHttpRequest) extends Exception {
2021
def isTimeout = xhr.status == 0 && xhr.readyState == 4
2122
}
2223

24+
// This is just there to work around some weird warnings in Scala 3.x
25+
@deprecated("use the dom.fetch API instead", "2.0.0")
26+
object AjaxException extends (dom.XMLHttpRequest => AjaxException)
27+
2328
/**
2429
* Wraps an XMLHttpRequest to provide an easy one-line way of making
2530
* an Ajax call, returning a Future.
2631
*/
32+
@deprecated("use the dom.fetch API instead", "2.0.0")
2733
object Ajax {
2834

2935
/**

0 commit comments

Comments
 (0)