404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.117.7.15: ~ $
import { ObservableInput } from '../types';
import { subscribeToArray } from './subscribeToArray';
import { subscribeToPromise } from './subscribeToPromise';
import { subscribeToIterable } from './subscribeToIterable';
import { subscribeToObservable } from './subscribeToObservable';
import { isArrayLike } from './isArrayLike';
import { isPromise } from './isPromise';
import { isObject } from './isObject';
import { iterator as Symbol_iterator } from '../symbol/iterator';
import { observable as Symbol_observable } from '../symbol/observable';
import { Subscription } from '../Subscription';
import { Subscriber } from '../Subscriber';

export const subscribeTo = <T>(result: ObservableInput<T>): (subscriber: Subscriber<T>) => Subscription | void => {
  if (!!result && typeof result[Symbol_observable] === 'function') {
    return subscribeToObservable(result as any);
  } else if (isArrayLike(result)) {
    return subscribeToArray(result);
  } else if (isPromise(result)) {
    return subscribeToPromise(result as Promise<any>);
  } else if (!!result && typeof result[Symbol_iterator] === 'function') {
    return subscribeToIterable(result as any);
  } else {
    const value = isObject(result) ? 'an invalid object' : `'${result}'`;
    const msg = `You provided ${value} where a stream was expected.`
      + ' You can provide an Observable, Promise, Array, or Iterable.';
    throw new TypeError(msg);
  }
};

Filemanager

Name Type Size Permission Actions
ArgumentOutOfRangeError.ts File 857 B 0644
EmptyError.ts File 643 B 0644
Immediate.ts File 1.02 KB 0644
ObjectUnsubscribedError.ts File 787 B 0644
TimeoutError.ts File 586 B 0644
UnsubscriptionError.ts File 875 B 0644
applyMixins.ts File 406 B 0644
canReportError.ts File 692 B 0644
errorObject.ts File 133 B 0644
hostReportError.ts File 237 B 0644
identity.ts File 53 B 0644
isArray.ts File 112 B 0644
isArrayLike.ts File 124 B 0644
isDate.ts File 104 B 0644
isFunction.ts File 88 B 0644
isInteropObservable.ts File 354 B 0644
isIterable.ts File 246 B 0644
isNumeric.ts File 427 B 0644
isObject.ts File 96 B 0644
isObservable.ts File 380 B 0644
isPromise.ts File 365 B 0644
isScheduler.ts File 174 B 0644
noop.ts File 57 B 0644
not.ts File 259 B 0644
pipe.ts File 2.72 KB 0644
root.ts File 1.09 KB 0644
subscribeTo.ts File 1.39 KB 0644
subscribeToArray.ts File 389 B 0644
subscribeToIterable.ts File 830 B 0644
subscribeToObservable.ts File 666 B 0644
subscribeToPromise.ts File 440 B 0644
subscribeToResult.ts File 1.13 KB 0644
toSubscriber.ts File 779 B 0644
tryCatch.ts File 426 B 0644