scheduled.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.scheduled = void 0;
  4. var scheduleObservable_1 = require("./scheduleObservable");
  5. var schedulePromise_1 = require("./schedulePromise");
  6. var scheduleArray_1 = require("./scheduleArray");
  7. var scheduleIterable_1 = require("./scheduleIterable");
  8. var scheduleAsyncIterable_1 = require("./scheduleAsyncIterable");
  9. var isInteropObservable_1 = require("../util/isInteropObservable");
  10. var isPromise_1 = require("../util/isPromise");
  11. var isArrayLike_1 = require("../util/isArrayLike");
  12. var isIterable_1 = require("../util/isIterable");
  13. var isAsyncIterable_1 = require("../util/isAsyncIterable");
  14. var throwUnobservableError_1 = require("../util/throwUnobservableError");
  15. var isReadableStreamLike_1 = require("../util/isReadableStreamLike");
  16. var scheduleReadableStreamLike_1 = require("./scheduleReadableStreamLike");
  17. function scheduled(input, scheduler) {
  18. if (input != null) {
  19. if (isInteropObservable_1.isInteropObservable(input)) {
  20. return scheduleObservable_1.scheduleObservable(input, scheduler);
  21. }
  22. if (isArrayLike_1.isArrayLike(input)) {
  23. return scheduleArray_1.scheduleArray(input, scheduler);
  24. }
  25. if (isPromise_1.isPromise(input)) {
  26. return schedulePromise_1.schedulePromise(input, scheduler);
  27. }
  28. if (isAsyncIterable_1.isAsyncIterable(input)) {
  29. return scheduleAsyncIterable_1.scheduleAsyncIterable(input, scheduler);
  30. }
  31. if (isIterable_1.isIterable(input)) {
  32. return scheduleIterable_1.scheduleIterable(input, scheduler);
  33. }
  34. if (isReadableStreamLike_1.isReadableStreamLike(input)) {
  35. return scheduleReadableStreamLike_1.scheduleReadableStreamLike(input, scheduler);
  36. }
  37. }
  38. throw throwUnobservableError_1.createInvalidObservableTypeError(input);
  39. }
  40. exports.scheduled = scheduled;
  41. //# sourceMappingURL=scheduled.js.map