Is it possible to retrieve the http status code of a request made using scalajs-angular?
Currently, I am able to obtain it by using http.get[js.Any]("url") success
and specifying a function with type (js.Any, Int) => Unit
. However, I would prefer to return something other than Unit.
For example, I wish to be able to achieve the following:
http.get[js.Any]("url") map {
case response.status == 200 => true
case _ => false
}
What approach should I take to accomplish this?