BACK
Referenceconcat
Reference · 28

concat

Plays streams strictly one after another.

Signature

concat(...sources: ObservableInput[]): Observable

Marble diagram

a:        --1--2|
b:               --3--4|
result:   --1--2--3--4|

What it does

Subscribes to the first source. After it completes, it subscribes to the second, and so on. If a previous one never completes, the next never starts.

When to use

The "show the cache, then load fresh data" scenario: concat(cache$, network$). Cascading init: DB migrations → module loading → UI ready.

See also

merge, concatMap, startWith

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...