{% if book.isPdf==true %}
{% endif %}
Concatenates all of the specified observable sequences, as long as the previous observable sequence terminated successfully.
args
(Array
|arguments
): Observable sequences or Promises to concatenate.
(Observable
): An observable sequence that contains the elements of each given sequence, in sequential order.
{% if book.isPdf %}
/* Using Observable sequences */
var source1 = Rx.Observable.return(42);
var source2 = Rx.Observable.return(56);
var source = Rx.Observable.concat(source1, source2);
var subscription = source.subscribe(
x => console.log(`onNext: ${x}`),
e => console.log(`onError: ${e}`),
() => console.log('onCompleted'));
// => onNext: 42
// => onNext: 56
// => onCompleted
/* Using Promises and Observable sequences */
var source1 = Rx.Observable.return(42);
var source2 = RSVP.Promise.resolve(56);
var source = Rx.Observable.concat(source1, source2);
var subscription = source.subscribe(
x => console.log(`onNext: ${x}`),
e => console.log(`onError: ${e}`),
() => console.log('onCompleted'));
// => onNext: 42
// => onNext: 56
// => onCompleted
{% else %}
{% endif %}