Home rxswift subject
Post
Cancel

rxswift subject

SubjectType

Represents an object that is both an observable sequeue as well as an observer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public protocol SubjectType : ObservableType {
    /// The type of the observer that represents this subject.
    ///
    /// Usually this type is type of subject itself, but it doesn't have to be.
    associatedtype Observer: ObserverType

    @available(*, deprecated, renamed: "Observer")
    typealias SubjectObserverType = Observer

    /// Returns observer interface for subject.
    ///
    /// - returns: Observer interface for subject.
    func asObserver() -> Observer
    
}

注:文中源码来自RxSwift

This post is licensed under CC BY 4.0 by the author.