scheduled.js 1.3 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var scheduleObservable_1 = require("./scheduleObservable");
  4. var schedulePromise_1 = require("./schedulePromise");
  5. var scheduleArray_1 = require("./scheduleArray");
  6. var scheduleIterable_1 = require("./scheduleIterable");
  7. var isInteropObservable_1 = require("../util/isInteropObservable");
  8. var isPromise_1 = require("../util/isPromise");
  9. var isArrayLike_1 = require("../util/isArrayLike");
  10. var isIterable_1 = require("../util/isIterable");
  11. function scheduled(input, scheduler) {
  12. if (input != null) {
  13. if (isInteropObservable_1.isInteropObservable(input)) {
  14. return scheduleObservable_1.scheduleObservable(input, scheduler);
  15. }
  16. else if (isPromise_1.isPromise(input)) {
  17. return schedulePromise_1.schedulePromise(input, scheduler);
  18. }
  19. else if (isArrayLike_1.isArrayLike(input)) {
  20. return scheduleArray_1.scheduleArray(input, scheduler);
  21. }
  22. else if (isIterable_1.isIterable(input) || typeof input === 'string') {
  23. return scheduleIterable_1.scheduleIterable(input, scheduler);
  24. }
  25. }
  26. throw new TypeError((input !== null && typeof input || input) + ' is not observable');
  27. }
  28. exports.scheduled = scheduled;
  29. //# sourceMappingURL=scheduled.js.map