just图标说明如下:
/**
Returns an observable sequence that contains a single element.
seealso: http://reactivex.io/documentation/operators/just.html
*/
public static func just(element: E)->Observable<E> {
return Just(element: element)
}
class Just<Element>: Producer<Element> {
private let _element: Element
init(element: Element) {
_element = element
}
override func subscribe<O: ObserverType where O.E == Element>(observer: O)->Disposable {
observer.on(.Next(_element))
observer.on(.Completed)
return NopDisposable.instance
}
}