Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / observable / fromArray.ts
1 import { Observable } from '../Observable';
2 import { SchedulerLike } from '../types';
3 import { subscribeToArray } from '../util/subscribeToArray';
4 import { scheduleArray } from '../scheduled/scheduleArray';
5
6 export function fromArray<T>(input: ArrayLike<T>, scheduler?: SchedulerLike) {
7   if (!scheduler) {
8     return new Observable<T>(subscribeToArray(input));
9   } else {
10     return scheduleArray(input, scheduler);
11   }
12 }