EventSource class

Inheritance
Annotations
  • @DomName('EventSource')
  • @Experimental()

Constants

CLOSEDint
@DocsEditable(), @DomName('EventSource.CLOSED')
2
CONNECTINGint
@DocsEditable(), @DomName('EventSource.CONNECTING')
0
errorEventEventStreamProvider<Event>
@DocsEditable(), @DomName('EventSource.errorEvent')

Static factory designed to expose error events to event handlers that are not necessarily instances of EventSource.

const EventStreamProvider<Event>('error')
messageEventEventStreamProvider<MessageEvent>
@DocsEditable(), @DomName('EventSource.messageEvent')

Static factory designed to expose message events to event handlers that are not necessarily instances of EventSource.

const EventStreamProvider<MessageEvent>('message')
OPENint
@DocsEditable(), @DomName('EventSource.OPEN')
1
openEventEventStreamProvider<Event>
@DocsEditable(), @DomName('EventSource.openEvent')

Static factory designed to expose open events to event handlers that are not necessarily instances of EventSource.

const EventStreamProvider<Event>('open')

Static Properties

instanceRuntimeTypeType
@Deprecated("Internal Use Only"), read-only

Constructors

EventSource(String url, { withCredentials: false })
factory
EventSource.internal_()

Properties

onErrorStream<Event>
@DocsEditable(), @DomName('EventSource.onerror'), read-only

Stream of error events handled by this EventSource.

onMessageStream<MessageEvent>
@DocsEditable(), @DomName('EventSource.onmessage'), read-only

Stream of message events handled by this EventSource.

onOpenStream<Event>
@DocsEditable(), @DomName('EventSource.onopen'), read-only

Stream of open events handled by this EventSource.

readyStateint
@DocsEditable(), @DomName('EventSource.readyState'), read-only
urlString
@DocsEditable(), @DomName('EventSource.url'), read-only
withCredentialsbool
@DocsEditable(), @DomName('EventSource.withCredentials'), read-only
hashCodeint
read-only, inherited
onEvents
read-only, inherited

This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.

runtimeTypeType
read-only, inherited

A representation of the runtime type of the object.

Operators

operator ==(other) → bool
inherited

The equality operator.

Methods

close() → void
@DocsEditable(), @DomName('EventSource.close')
addEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
dispatchEvent(Event event) → bool
@DocsEditable(), @DomName('EventTarget.dispatchEvent'), inherited
noSuchMethod(Invocation invocation) → dynamic
inherited

Invoked when a non-existent method or property is accessed.

removeEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
toString() → String
inherited

Returns the result of the JavaScript objects toString method.

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/EventSource-class.html