RxJS ConnectableObservable

2020-10-12 14:07 更新
class ConnectableObservable<T> extends Observable {
  constructor(source: Observable<T>, subjectFactory: () => Subject<T>)
  protected _subject: Subject<T>
  protected _refCount: number
  protected _connection: Subscription
  source: Observable<T>
  protected subjectFactory: () => Subject<T>
  _subscribe(subscriber: Subscriber<T>)
  protected getSubject(): Subject<T>
  connect(): Subscription
  refCount(): Observable<T>

 
  // inherited from index/Observable
  static create: Function
  static if: typeof iif
  static throw: typeof throwError
  constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic)
  _isScalar: boolean
  source: Observable<any>
  operator: Operator<any, T>
  lift<R>(operator: Operator<T, R>): Observable<R>
  subscribe(observerOrNext?: NextObserver<T> | ErrorObserver<T> | CompletionObserver<T> | ((value: T) => void), error?: (error: any) => void, complete?: () => void): Subscription
  _trySubscribe(sink: Subscriber<T>): TeardownLogic
  forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void>
  pipe(...operations: OperatorFunction<any, any>[]): Observable<any>
  toPromise(promiseCtor?: PromiseConstructorLike): Promise<T>
}

建設(shè)者

constructor(source: Observable<T>, subjectFactory: () => Subject<T>)`

參量: 類型:
資源 類型:Observable
subjectFactory 類型:。`() => Subject

物產(chǎn)

屬性 類型 描述
_學(xué)科 Subject<T>
_refCount number
_連接 Subscription
資源 Observable<T> 在構(gòu)造函數(shù)中聲明。
subjectFactory () => Subject<T> 在構(gòu)造函數(shù)中聲明。

方法

_訂閱() _subscribe(subscriber: Subscriber<T>)

參量: 類型:
訂戶 類型:。Subscriber

getSubject()
protected getSubject(): Subject<T>參量沒有參數(shù)。退貨Subject<T>

connect()
connect(): Subscription參量沒有參數(shù)。退貨Subscription

refCount()
refCount(): Observable<T>參量沒有參數(shù)。退貨Observable<T>
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號