com.raquo.airstream.web

Members list

Type members

Classlikes

class AjaxStream(method: String, url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], uploadProgressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]) extends WritableStream[XMLHttpRequest]

AjaxStream performs an HTTP request and emits an dom.XMLHttpRequest on success, or an AjaxStreamError error (AjaxStatusError | AjaxNetworkError | AjaxTimeout | AjaxAbort) on failure.

AjaxStream performs an HTTP request and emits an dom.XMLHttpRequest on success, or an AjaxStreamError error (AjaxStatusError | AjaxNetworkError | AjaxTimeout | AjaxAbort) on failure.

Acceptable HTTP response status codes are 2xx and 304, others result in AjaxStatusError.

The network request is only performed when the stream is started.

When stream is restarted, a new request is performed, and the subsequent response is emitted. The previous request is not aborted, but its response will be ignored.

Warning: dom.XmlHttpRequest is an ugly, imperative JS construct. We set event callbacks for onload, onerror, onabort, ontimeout, and if requested, also for onprogress and onreadystatechange. Make sure you don't override Airstream's listeners, or this stream will not work properly.

Value parameters

progressObserver
  • called when download progress is reported
readyStateChangeObserver
  • called when readyState changes
requestObserver
  • called just before the request is sent
uploadProgressObserver
  • called when upload progress is reported

Attributes

See also

dom.XMLHttpRequest for a description of the parameters

Companion
object
Supertypes
trait WritableStream[XMLHttpRequest]
trait WritableObservable[XMLHttpRequest]
trait EventStream[XMLHttpRequest]
trait EventSource[XMLHttpRequest]
trait Observable[XMLHttpRequest]
trait BaseObservable[EventStream, XMLHttpRequest]
trait Named
trait Source[XMLHttpRequest]
class Object
trait Matchable
class Any
Show all
object AjaxStream

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
AjaxStream.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class FetchBuilder[In, Out](encodeRequest: In => BodyInit, decodeResponse: Response => EventStream[Out])

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FetchStream.type
class FetchOptions[In]

Attributes

Supertypes
class Object
trait Matchable
class Any
object FetchStream extends FetchBuilder[BodyInit, String]

Note: dom.BodyInit is a union type that includes String and some other Javascript-specific data types.

Note: dom.BodyInit is a union type that includes String and some other Javascript-specific data types.

Attributes

Companion
class
Supertypes
class FetchBuilder[BodyInit, String]
class Object
trait Matchable
class Any
Self type
class FetchStream extends WritableStream[Promise[Response]]

Make requests using the Fetch API, the modern alternative to Ajax.

Make requests using the Fetch API, the modern alternative to Ajax.

Attributes

See also

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API Use get / post / apply / etc. methods on FetchStream companion object to make Fetch requests.

Companion
object
Supertypes
trait WritableStream[Promise[Response]]
trait WritableObservable[Promise[Response]]
trait EventStream[Promise[Response]]
trait EventSource[Promise[Response]]
trait Observable[Promise[Response]]
trait BaseObservable[EventStream, Promise[Response]]
trait Named
trait Source[Promise[Response]]
class Object
trait Matchable
class Any
Show all

Deprecated types

Attributes

Deprecated
true

Value members

Deprecated fields

lazy val AjaxEventStream: AjaxStream.type

Attributes

Deprecated
true