Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

mapTo.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. }
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. var Subscriber_1 = require("../Subscriber");
  17. function mapTo(value) {
  18. return function (source) { return source.lift(new MapToOperator(value)); };
  19. }
  20. exports.mapTo = mapTo;
  21. var MapToOperator = (function () {
  22. function MapToOperator(value) {
  23. this.value = value;
  24. }
  25. MapToOperator.prototype.call = function (subscriber, source) {
  26. return source.subscribe(new MapToSubscriber(subscriber, this.value));
  27. };
  28. return MapToOperator;
  29. }());
  30. var MapToSubscriber = (function (_super) {
  31. __extends(MapToSubscriber, _super);
  32. function MapToSubscriber(destination, value) {
  33. var _this = _super.call(this, destination) || this;
  34. _this.value = value;
  35. return _this;
  36. }
  37. MapToSubscriber.prototype._next = function (x) {
  38. this.destination.next(this.value);
  39. };
  40. return MapToSubscriber;
  41. }(Subscriber_1.Subscriber));
  42. //# sourceMappingURL=mapTo.js.map