/** * Tae Won Ha - http://taewon.de - @hataewon * See LICENSE */ import Cocoa import RxSwift extension Array { /// This method only makes sense for `Array>`. /// - Returns: Merged observables func toMergedObservables() -> Observable { return Observable .from(self.flatMap { $0 as? Observable }) .flatMap { $0 } } } extension ObservableType { func mapOmittingNil(_ transform: @escaping (Self.E) throws -> R?) -> RxSwift.Observable { return self .map(transform) .filter { $0 != nil } .map { $0! } } }