Chapter 9 comment - page 188

The following line is not entirely correct:

The Observable.concat(_ : ) static method takes an ordered collection of observables (i.e. an array).

This is related to the code:

let observable = Observable.concat([first, second])

It works OK without brackets, i.e.:

let observable = Observable.concat(first, second)

Even more, this one works OK too:

let first = Observable.of(1, 2, 3)
let second = Observable.of(4, 5, 6)
let three = Observable.of(77)
let observable = Observable.concat(first, second, three)

So, I guess, words i.e. an array in that line is kind of misleading.

@fpillet Can you please help with this when you get a chance? Thank you - much appreciated! :]

@konic you’re right, it’s one of the variants of the concat operator which takes a variable number of arguments instead of a collection (in the end result is the same but the way you pass the parameters is slightly different).

Good catch, I’ll add a note about this in the next edition!

This topic was automatically closed after 166 days. New replies are no longer allowed.