• RxSwift源码与模式分析一:基本类


    封装、变换与处理

    // Represents a push style sequence.

    public protocol ObservableType : ObservableConvertibleType {

          func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E

    }

    /// It represents a push style sequence.

    public class Observable<Element> : ObservableType {

        public typealias E = Element

        

        public func subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E {

            rxAbstractMethod()

        }

        

        public func asObservable() -> Observable<E> {

            return self

        }

        /// Optimizations for map operator

        internal func composeMap<R>(_ transform: @escaping (Element) throws -> R) -> Observable<R> {

            return _map(source: self, transform: transform)

        }

    }

    public protocol ObserverType {

        associatedtype E

        func on(_ event: Event<E>)

    }

    public enum Event<Element> {

        case next(Element)

        case error(Swift.Error)

        case completed

    }

    public struct Reactive<Base> {

        public let base: Base

        public init(_ base: Base) {

            self.base = base

        }

    }

    public struct Binder<Value>: ObserverType

  • 相关阅读:
    ASP.NET MVC 动态加载图像
    ASP.NET:以域用户身份访问网络资源
    ASP.NET MVC 动态加载 *.ascx
    4月
    3月
    2月
    每天充点小能量
    每天进步一点点
    FreeMarker标签与使用
    eclipse启动tomcat, http://localhost:8080无法访问
  • 原文地址:https://www.cnblogs.com/feng9exe/p/9004605.html
Copyright © 2020-2023  润新知