object Observable extends ObservableInstances
- Alphabetic
- By Inheritance
- Observable
- ObservableInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type Creator = |[Unit, () ⇒ Unit]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ajax(settings: Request): Observable[Response]
- def ajax(url: String): Observable[Dynamic]
-
def
apply[T](f: (Observer[T]) ⇒ Creator): Observable[T]
Returns an Observable that will execute the specified function when someone subscribes to it.
Returns an Observable that will execute the specified function when someone subscribes to it.
Write the function you pass so that it behaves as an Observable: It should invoke the Subscriber's
next
,error
, andcompleted
methods appropriately.See Rx Design Guidelines (PDF) for detailed information.
See
RxScalaDemo.createExampleGood
andRxScalaDemo.createExampleGood2
.- T
the type of the items that this Observable emits
- f
a function that accepts a
Observer[T]
, and invokes itsnext
,onError
, andonCompleted
methods as appropriate- returns
an Observable that, when someone subscribes to it, will execute the specified function
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bindCallback[T, U](callbackFunc: Function, selector: Function, scheduler: Scheduler): Function1[U, ObservableFacade[T]]
Converts a callback API to a function that returns an Observable.
Converts a callback API to a function that returns an Observable.
Give it a function `f` of type `f(x, callback)` and it will return a function `g` that when called as `g(x)` will output an Observable.
bindCallback
is not an operator because its input and output are not Observables. The input is a functionfunc
with some parameters, but the last parameter must be a callback function thatfunc
calls when it is done. The output ofbindCallback
is a function that takes the same parameters asfunc
, except the last one (the callback). When the output function is called with arguments, it will return an Observable where the results will be delivered to.- callbackFunc
Function with a callback as the last parameter.
- selector
A function which takes the arguments from the callback and maps those a value to emit on the output Observable.
- scheduler
The scheduler on which to schedule the callbacks.
- returns
A function which returns the Observable that delivers the same values the callback would deliver.
-
def
bindNodeCallback[T, U](callbackFunc: Function, selector: Function, scheduler: Scheduler): Function1[U, ObservableFacade[T]]
Converts a Node.js-style callback API to a function that returns an Observable.
Converts a Node.js-style callback API to a function that returns an Observable.
It's just like `bindCallback`, but the callback is expected to be of type `callback(error, result)`.
bindNodeCallback
is not an operator because its input and output are not Observables. The input is a functionfunc
with some parameters, but the last parameter must be a callback function thatfunc
calls when it is done. The callback function is expected to follow Node.js conventions, where the first argument to the callback is an error, while remaining arguments are the callback result. The output ofbindNodeCallback
is a function that takes the same parameters asfunc
, except the last one (the callback). When the output function is called with arguments, it will return an Observable where the results will be delivered to.- callbackFunc
Function with a callback as the last parameter.
- selector
A function which takes the arguments from the callback and maps those a value to emit on the output Observable.
- scheduler
The scheduler on which to schedule the callbacks.
- returns
A function which returns the Observable that delivers the same values the callback would deliver.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
combineLatest[T](sources: Seq[Observable[T]]): Observable[Seq[T]]
Combines a list of source Observables by emitting an item that aggregates the latest values of each of the source Observables each time an item is received from any of the source Observables.
Combines a list of source Observables by emitting an item that aggregates the latest values of each of the source Observables each time an item is received from any of the source Observables.
- T
the common base type of source values
- sources
the list of source Observables
- returns
an Observable that emits items that are the result of combining the items emitted by the source Observables
-
def
combineLatestWith[T, R](sources: Seq[Observable[T]])(combineFunction: (Seq[T]) ⇒ R): Observable[R]
Combines a list of source Observables by emitting an item that aggregates the latest values of each of the source Observables each time an item is received from any of the source Observables, where this aggregation is defined by a specified function.
Combines a list of source Observables by emitting an item that aggregates the latest values of each of the source Observables each time an item is received from any of the source Observables, where this aggregation is defined by a specified function.
- T
the common base type of source values
- R
the result type
- sources
the list of source Observables
- combineFunction
the aggregation function used to combine the items emitted by the source Observables
- returns
an Observable that emits items that are the result of combining the items emitted by the source Observables by means of the given aggregation function
-
def
create[T](f: (Observer[T]) ⇒ Creator): Observable[T]
Returns an Observable that will execute the specified function when someone subscribes to it.
Returns an Observable that will execute the specified function when someone subscribes to it.
Write the function you pass so that it behaves as an Observable: It should invoke the Subscriber's
next
,error
, andcompleted
methods appropriately.See Rx Design Guidelines (PDF) for detailed information.
See
RxScalaDemo.createExampleGood
andRxScalaDemo.createExampleGood2
.- T
the type of the items that this Observable emits
- f
a function that accepts a
Observer[T]
, and invokes itsnext
,onError
, andonCompleted
methods as appropriate. It can also return a Teardown function that will be called once the Observable is disposed.- returns
an Observable that, when someone subscribes to it, will execute the specified function
-
def
empty: Observable[Nothing]
Creates an Observable that emits no items to the Observer and immediately emits a complete notification.
Creates an Observable that emits no items to the Observer and immediately emits a complete notification.
This static operator is useful for creating a simple Observable that only emits the complete notification. It can be used for composing with other Observables, such as in a mergeMap.
- returns
an Observable that emits only the complete notification.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def forkJoin[T](sources: Observable[T]*): Observable[Seq[T]]
-
def
from[T](future: Future[T])(implicit execContext: ExecutionContext): Observable[T]
Returns an Observable emitting the value produced by the Future as its single item.
Returns an Observable emitting the value produced by the Future as its single item. If the future fails, the Observable will fail as well.
- future
Future whose value ends up in the resulting Observable
- returns
an Observable completed after producing the value of the future, or with an exception
-
def
from[T](seq: Seq[T]): Observable[T]
Converts a
Seq
into an Observable.Converts a
Seq
into an Observable.Note: the entire iterable sequence is immediately emitted each time an Observer subscribes. Since this occurs before the
Subscription
is returned, it is not possible to unsubscribe from the sequence before it completes.- T
the type of items in the
Seq
sequence and the type of items to be emitted by the resulting Observable- seq
the source
Seq
sequence- returns
an Observable that emits each item in the source
Iterable
sequence
-
def
fromEvent(element: Element, eventName: String): Observable[Event]
Creates an Observable that emits events of a specific type coming from the given event target.
Creates an Observable that emits events of a specific type coming from the given event target.
Creates an Observable by attaching an event listener to an "event target", which may be an object with addEventListener and removeEventListener, a Node.js EventEmitter, a jQuery style EventEmitter, a NodeList from the DOM, or an HTMLCollection from the DOM. The event handler is attached when the output Observable is subscribed, and removed when the Subscription is unsubscribed.
- def fromJSObservable[T](jsObservable: ObservableFacade[T]): Observable[T]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
interval(duration: Int): Observable[Int]
Emits
0
,1
,2
,...
with a delay ofduration
between consecutive numbers.Emits
0
,1
,2
,...
with a delay ofduration
between consecutive numbers.- duration
duration in milliseconds between two consecutive numbers
- returns
An Observable that emits a number each time interval.
-
def
interval(duration: Duration = Duration.Zero): Observable[Int]
Emits
0
,1
,2
,...
with a delay ofduration
between consecutive numbers.Emits
0
,1
,2
,...
with a delay ofduration
between consecutive numbers.- duration
duration between two consecutive numbers
- returns
An Observable that emits a number each time interval.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
just[T](values: T*): Observable[T]
Converts a sequence of values into an Observable.
Converts a sequence of values into an Observable.
Implementation note: the entire array will be immediately emitted each time an rxscalajs.subscription.ObserverFacade subscribes. Since this occurs before the subscription.Subscription is returned, it in not possible to unsubscribe from the sequence before it completes.
- T
the type of items in the Array, and the type of items to be emitted by the resulting Observable
- values
the source Array
- returns
an Observable that emits each item in the source Array
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
never: Observable[Nothing]
Returns an Observable that never sends any items or notifications to an Observer.
Returns an Observable that never sends any items or notifications to an Observer.
This Observable is useful primarily for testing purposes.
- returns
an Observable that never sends any items or notifications to an Observer
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
implicit
val
observableMonad: MonadError[Observable, Any]
- Definition Classes
- ObservableInstances
-
implicit
def
observableMonoid[A](implicit arg0: Monoid[A]): Monoid[Observable[A]]
- Definition Classes
- ObservableInstances
-
implicit
val
observableMonoidK: MonoidK[Observable]
- Definition Classes
- ObservableInstances
-
def
of[T](elements: T*): Observable[T]
Converts a sequence of values into an Observable.
Converts a sequence of values into an Observable.
Implementation note: the entire array will be immediately emitted each time an rxscalajs.subscription.ObserverFacade subscribes. Since this occurs before the subscription.Subscription is returned, it in not possible to unsubscribe from the sequence before it completes.
- T
the type of items in the Array, and the type of items to be emitted by the resulting Observable
- elements
the source Array
- returns
an Observable that emits each item in the source Array
-
def
race[T](observables: Observable[T]*): Observable[T]
Returns an Observable that mirrors the first source Observable to emit an item from the combination of this Observable and supplied Observables
Returns an Observable that mirrors the first source Observable to emit an item from the combination of this Observable and supplied Observables
- observables
sources used to race for which Observable emits first.
- returns
an Observable that mirrors the output of the first Observable to emit an item.
-
def
range(start: Int = 0, count: Int = 0): Observable[Int]
Creates an Observable that emits a sequence of numbers within a specified range.
Creates an Observable that emits a sequence of numbers within a specified range.
Emits a sequence of numbers in a range.
range
operator emits a range of sequential integers, in order, where you select thestart
of the range and itslength
. By default, uses no Scheduler and just delivers the notifications synchronously, but may use an optional Scheduler to regulate those deliveries.- start
The value of the first integer in the sequence.
- count
The number of sequential integers to generate. the emissions of the notifications.
- returns
An Observable of numbers that emits a finite range of sequential integers.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
timer(initialDelay: Int = 0, period: Int = 1): Observable[Int]
Returns an Observable that emits
0L
after a specified delay, and then completes.Returns an Observable that emits
0L
after a specified delay, and then completes.- initialDelay
the initial delay before emitting a single
0L
- returns
Observable that emits
0L
after a specified delay, and then completes
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zip[T, R](observables: Seq[Observable[T]])(project: (Seq[T]) ⇒ R): Observable[R]
Given a number of observables, returns an observable that emits a combination of each.
Given a number of observables, returns an observable that emits a combination of each. The first emitted combination will contain the first element of each source observable, the second combination the second element of each source observable, and so on.
- project
a function that combines the items from the Observable and the Iterable to generate the items to be emitted by the resulting Observable
- returns
an Observable that emits the zipped Observables