Sha256: d08d3f3dac0ca1b513c33d72e2a13084f2a04f2e3830003801709f1f304a1940

Contents?: true

Size: 752 Bytes

Versions: 49

Compression:

Stored size: 752 Bytes

Contents

import { Subscriber } from '../Subscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
import { PartialObserver, empty as emptyObserver } from '../Observer';

export function toSubscriber<T>(
  nextOrObserver?: PartialObserver<T> | ((value: T) => void),
  error?: (error: any) => void,
  complete?: () => void): Subscriber<T> {

  if (nextOrObserver) {
    if (nextOrObserver instanceof Subscriber) {
      return (<Subscriber<T>> nextOrObserver);
    }

    if (nextOrObserver[rxSubscriberSymbol]) {
      return nextOrObserver[rxSubscriberSymbol]();
    }
  }

  if (!nextOrObserver && !error && !complete) {
    return new Subscriber(emptyObserver);
  }

  return new Subscriber(nextOrObserver, error, complete);
}

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
ilog-0.4.1 node_modules/rxjs/src/util/toSubscriber.ts
ilog-0.4.0 node_modules/rxjs/src/util/toSubscriber.ts
ilog-0.3.3 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-18.0.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.21.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.20.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.19.1 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.19.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.18.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.17.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.16.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.15.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.14.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.13.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.12.2 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.12.1 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.12.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.11.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.10.0 node_modules/rxjs/src/util/toSubscriber.ts
govuk_publishing_components-17.9.0 node_modules/rxjs/src/util/toSubscriber.ts