# Concat operator

**URL:** <https://forums.kodeco.com/t/concat-operator/43190>\
**Category:** RxSwift\
**Created:** [June 3, 2018, 4:45am UTC](https://forums.kodeco.com/t/concat-operator/43190 "2018-06-03T04:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cuong1112035](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/cuong1112035/32/101506_2.png) [@cuong1112035](https://forums.kodeco.com/u/cuong1112035)\
**Post date:** [June 3, 2018, 4:45am UTC](https://forums.kodeco.com/t/concat-operator/43190/1 "2018-06-03T04:45:49Z")

</div>

Hi all

I have some code like this:

> ```
> let first = Observable<Int>.create({ observer -> Disposable in
> observer.onNext(1)
> return Disposables.create()
> })
> let second = Observable.of(4, 5, 6)
> let observableConcat = Observable.concat([first, second])
> observableConcat.subscribe({ (event) in
> print(event)
> })
> 
> ```

The book describes the concat operator as: “It subscribes to the first sequence of the collection, relays its elements until it completes, then moves to the next one. The process repeats until all the observables in the collection have been used”.  
So that I expected the result from the code snippet would be 1, 4, 5, 6 but what I got is 1 only.  
Please teach me what I did misunderstand about the concat operator.  
Thanks so much.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [November 16, 2018, 8:59pm UTC](https://forums.kodeco.com/t/concat-operator/43190/2 "2018-11-16T20:59:04Z")

</div>

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