be25a9aca9fce4cb5c27be5de01148d0ee1fe4692b618c080d74895e12f9d9ae52326aa7ed30b698d274e1ebf76b7da4308fd5a34cd1521ee8d130a08685c1 559 B

1234567891011121314151617
  1. import { Observable } from '../Observable';
  2. import { Subscriber } from '../Subscriber';
  3. import { Subscribable } from '../types';
  4. /**
  5. * Used to convert a subscribable to an observable.
  6. *
  7. * Currently, this is only used within internals.
  8. *
  9. * TODO: Discuss ObservableInput supporting "Subscribable".
  10. * https://github.com/ReactiveX/rxjs/issues/5909
  11. *
  12. * @param subscribable A subscribable
  13. */
  14. export function fromSubscribable<T>(subscribable: Subscribable<T>) {
  15. return new Observable((subscriber: Subscriber<T>) => subscribable.subscribe(subscriber));
  16. }