I'm trying to use concatMap
on BehaviorRelay
but I'm getting this error:
Instance method 'concatMap' requires that '[Int]' conform to 'ObservableConvertibleType'
This is my implementation:
class MyClass{
var disposeBag = DisposeBag()
var subject: BehaviorRelay<[Int]> = BehaviorRelay(value: [1,2,3,4,5])
func doSomething() {
subject.asObservable().concatMap { $0 }
.subscribe { print($0) }
.disposed(by: disposeBag)
}
}
I'm getting the error on this line:
subject.asObservable().concatMap { $0 }
Any of you knows why I'm getting this error or how can fix this error on my implementation ?
I'll really appreciate your help.