scheduled.js 1.2 KB

123456789101112131415161718192021222324252627
  1. /** PURE_IMPORTS_START _scheduleObservable,_schedulePromise,_scheduleArray,_scheduleIterable,_util_isInteropObservable,_util_isPromise,_util_isArrayLike,_util_isIterable PURE_IMPORTS_END */
  2. import { scheduleObservable } from './scheduleObservable';
  3. import { schedulePromise } from './schedulePromise';
  4. import { scheduleArray } from './scheduleArray';
  5. import { scheduleIterable } from './scheduleIterable';
  6. import { isInteropObservable } from '../util/isInteropObservable';
  7. import { isPromise } from '../util/isPromise';
  8. import { isArrayLike } from '../util/isArrayLike';
  9. import { isIterable } from '../util/isIterable';
  10. export function scheduled(input, scheduler) {
  11. if (input != null) {
  12. if (isInteropObservable(input)) {
  13. return scheduleObservable(input, scheduler);
  14. }
  15. else if (isPromise(input)) {
  16. return schedulePromise(input, scheduler);
  17. }
  18. else if (isArrayLike(input)) {
  19. return scheduleArray(input, scheduler);
  20. }
  21. else if (isIterable(input) || typeof input === 'string') {
  22. return scheduleIterable(input, scheduler);
  23. }
  24. }
  25. throw new TypeError((input !== null && typeof input || input) + ' is not observable');
  26. }
  27. //# sourceMappingURL=scheduled.js.map