forked from ard/ruoyi-api

‘liusuyi’
2023-06-30 3089fbc788d1dbd638d1cfd9c2f9b7f2011d0af0
1
2
3
4
5
6
7
8
9
10
11
12
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
import { subscribeToArray } from '../util/subscribeToArray';
import { scheduleArray } from '../scheduled/scheduleArray';
 
export function fromArray<T>(input: ArrayLike<T>, scheduler?: SchedulerLike) {
  if (!scheduler) {
    return new Observable<T>(subscribeToArray(input));
  } else {
    return scheduleArray(input, scheduler);
  }
}