source: trip-planner-front/node_modules/rxjs/src/internal/observable/fromPromise.ts@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 439 bytes
Line 
1import { Observable } from '../Observable';
2import { SchedulerLike } from '../types';
3import { subscribeToPromise } from '../util/subscribeToPromise';
4import { schedulePromise } from '../scheduled/schedulePromise';
5
6export function fromPromise<T>(input: PromiseLike<T>, scheduler?: SchedulerLike) {
7 if (!scheduler) {
8 return new Observable<T>(subscribeToPromise(input));
9 } else {
10 return schedulePromise(input, scheduler);
11 }
12}
Note: See TracBrowser for help on using the repository browser.