Files
ShadowsocksX-NG/Pods/RxSwift/RxSwift/Observables/Empty.swift
Qiu Yuzhou e6a22971d8 Make project build pass with swift 4.0
- pod update
- Force compile rxcocoa and rxswift with swift 3.2
2018-01-17 15:24:12 +08:00

28 lines
809 B
Swift

//
// Empty.swift
// RxSwift
//
// Created by Krunoslav Zaher on 8/30/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
extension Observable {
/**
Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message.
- seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
- returns: An observable sequence with no elements.
*/
public static func empty() -> Observable<E> {
return EmptyProducer<E>()
}
}
final fileprivate class EmptyProducer<Element> : Producer<Element> {
override func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.E == Element {
observer.on(.completed)
return Disposables.create()
}
}