source: trip-planner-front/node_modules/rxjs/src/internal/observable/fromIterable.ts

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

initial commit

  • Property mode set to 100644
File size: 511 bytes
Line 
1import { Observable } from '../Observable';
2import { SchedulerLike } from '../types';
3import { subscribeToIterable } from '../util/subscribeToIterable';
4import { scheduleIterable } from '../scheduled/scheduleIterable';
5
6export function fromIterable<T>(input: Iterable<T>, scheduler?: SchedulerLike) {
7 if (!input) {
8 throw new Error('Iterable cannot be null');
9 }
10 if (!scheduler) {
11 return new Observable<T>(subscribeToIterable(input));
12 } else {
13 return scheduleIterable(input, scheduler);
14 }
15}
Note: See TracBrowser for help on using the repository browser.