I would like to get the http status code of a request made with scalajs-angular.
I can get it with http.get[js.Any]("url") success
and a function of type (js.Any, Int) => Unit
. But I would like to return something else than Unit.
For instance, I would like to be able to do:
http.get[js.Any]("url") map {
case response.status == 200 => true
case _ => false
}
How can I do this?