2022-01-21 08:28:41 +00:00
|
|
|
import { scheduleObservable } from './scheduleObservable';
|
|
|
|
import { schedulePromise } from './schedulePromise';
|
|
|
|
import { scheduleArray } from './scheduleArray';
|
|
|
|
import { scheduleIterable } from './scheduleIterable';
|
2022-06-08 10:36:39 +00:00
|
|
|
import { scheduleAsyncIterable } from './scheduleAsyncIterable';
|
2022-01-21 08:28:41 +00:00
|
|
|
import { isInteropObservable } from '../util/isInteropObservable';
|
|
|
|
import { isPromise } from '../util/isPromise';
|
|
|
|
import { isArrayLike } from '../util/isArrayLike';
|
|
|
|
import { isIterable } from '../util/isIterable';
|
2022-06-08 10:36:39 +00:00
|
|
|
import { isAsyncIterable } from '../util/isAsyncIterable';
|
|
|
|
import { createInvalidObservableTypeError } from '../util/throwUnobservableError';
|
|
|
|
import { isReadableStreamLike } from '../util/isReadableStreamLike';
|
|
|
|
import { scheduleReadableStreamLike } from './scheduleReadableStreamLike';
|
2022-01-21 08:28:41 +00:00
|
|
|
export function scheduled(input, scheduler) {
|
|
|
|
if (input != null) {
|
|
|
|
if (isInteropObservable(input)) {
|
|
|
|
return scheduleObservable(input, scheduler);
|
|
|
|
}
|
2022-06-08 10:36:39 +00:00
|
|
|
if (isArrayLike(input)) {
|
|
|
|
return scheduleArray(input, scheduler);
|
|
|
|
}
|
|
|
|
if (isPromise(input)) {
|
2022-01-21 08:28:41 +00:00
|
|
|
return schedulePromise(input, scheduler);
|
|
|
|
}
|
2022-06-08 10:36:39 +00:00
|
|
|
if (isAsyncIterable(input)) {
|
|
|
|
return scheduleAsyncIterable(input, scheduler);
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2022-06-08 10:36:39 +00:00
|
|
|
if (isIterable(input)) {
|
2022-01-21 08:28:41 +00:00
|
|
|
return scheduleIterable(input, scheduler);
|
|
|
|
}
|
2022-06-08 10:36:39 +00:00
|
|
|
if (isReadableStreamLike(input)) {
|
|
|
|
return scheduleReadableStreamLike(input, scheduler);
|
|
|
|
}
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2022-06-08 10:36:39 +00:00
|
|
|
throw createInvalidObservableTypeError(input);
|
2022-01-21 08:28:41 +00:00
|
|
|
}
|
2022-04-07 07:06:43 +00:00
|
|
|
//# sourceMappingURL=scheduled.js.map
|