阅读(1177) (1)

RxJS Subscribable

2020-09-27 17:12:51 更新

可观察的界面

interface Subscribable<T> {  subscribe(observer?: PartialObserver<T>): Unsubscribable }

类的实现

  • Observable

  • ConnectableObservable

  • GroupedObservable

  • Subject

  • BehaviorSubject
  • ReplaySubject
  • AsyncSubject

方法

订阅() 4重载...subscribe(next: null, error: null, complete: () => void): Unsubscribable

参量 类型
下一个 类型:null
错误 类型:null
完成 类型:() => void

returnsUnsubscribable``subscribe(next: null, error: (error: any) => void, complete?: () => void): Unsubscribable

参量 类型
下一个 类型:null
错误 类型:(error: any) => void
完成 可选的。默认值为undefined类型:() => void

returnsUnsubscribable``subscribe(next: (value: T) => void, error: null, complete: () => void): Unsubscribable

参量 类型
下一个 类型:(value: T) => void
错误 类型:null
完成 类型:() => void

returnsUnsubscribable``subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable

参量 类型
下一个 可选的。默认值为undefined类型:(value: T) => void
错误 可选的。默认值为undefined。类型:(error: any) => void
完成 可选的。默认值为undefined。类型:() => void

returnsUnsubscribable