Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

endWith.js 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var fromArray_1 = require("../observable/fromArray");
  4. var scalar_1 = require("../observable/scalar");
  5. var empty_1 = require("../observable/empty");
  6. var concat_1 = require("../observable/concat");
  7. var isScheduler_1 = require("../util/isScheduler");
  8. function endWith() {
  9. var array = [];
  10. for (var _i = 0; _i < arguments.length; _i++) {
  11. array[_i] = arguments[_i];
  12. }
  13. return function (source) {
  14. var scheduler = array[array.length - 1];
  15. if (isScheduler_1.isScheduler(scheduler)) {
  16. array.pop();
  17. }
  18. else {
  19. scheduler = null;
  20. }
  21. var len = array.length;
  22. if (len === 1 && !scheduler) {
  23. return concat_1.concat(source, scalar_1.scalar(array[0]));
  24. }
  25. else if (len > 0) {
  26. return concat_1.concat(source, fromArray_1.fromArray(array, scheduler));
  27. }
  28. else {
  29. return concat_1.concat(source, empty_1.empty(scheduler));
  30. }
  31. };
  32. }
  33. exports.endWith = endWith;
  34. //# sourceMappingURL=endWith.js.map