1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 11:35:35 +03:00
vimr/VimR/RxSwiftCommons.swift

18 lines
315 B
Swift
Raw Normal View History

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
2016-08-03 22:41:43 +03:00
import Cocoa
import RxSwift
extension ObservableType {
func mapOmittingNil<R>(_ transform: @escaping (Self.E) throws -> R?) -> RxSwift.Observable<R> {
return self
.map(transform)
.filter { $0 != nil }
.map { $0! }
}
}