1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-27 15:53:31 +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! }
}
}