// // apply.swift // RxSwiftExt // // Created by Andy Chou on 2/22/17. // Copyright © 2017 RxSwift Community. All rights reserved. // import Foundation import RxSwift extension ObservableType { /// Apply a transformation function to the Observable. public func apply(_ transform: (Observable) -> Observable) -> Observable { return transform(self.asObservable()) } } extension PrimitiveSequenceType { /// Apply a transformation function to the primitive sequence. public func apply(_ transform: (PrimitiveSequence) -> PrimitiveSequence) -> PrimitiveSequence { return transform(self.primitiveSequence) } }