a zip code crypto-currency system good for red ONLY

finalize.js 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /** PURE_IMPORTS_START .._Subscriber,.._Subscription PURE_IMPORTS_END */
  2. var __extends = (this && this.__extends) || function (d, b) {
  3. for (var p in b)
  4. if (b.hasOwnProperty(p))
  5. d[p] = b[p];
  6. function __() { this.constructor = d; }
  7. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8. };
  9. import { Subscriber } from '../Subscriber';
  10. import { Subscription } from '../Subscription';
  11. /**
  12. * Returns an Observable that mirrors the source Observable, but will call a specified function when
  13. * the source terminates on complete or error.
  14. * @param {function} callback Function to be called when source terminates.
  15. * @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.
  16. * @method finally
  17. * @owner Observable
  18. */
  19. export function finalize(callback) {
  20. return function (source) { return source.lift(new FinallyOperator(callback)); };
  21. }
  22. var FinallyOperator = /*@__PURE__*/ (/*@__PURE__*/ function () {
  23. function FinallyOperator(callback) {
  24. this.callback = callback;
  25. }
  26. FinallyOperator.prototype.call = function (subscriber, source) {
  27. return source.subscribe(new FinallySubscriber(subscriber, this.callback));
  28. };
  29. return FinallyOperator;
  30. }());
  31. /**
  32. * We need this JSDoc comment for affecting ESDoc.
  33. * @ignore
  34. * @extends {Ignored}
  35. */
  36. var FinallySubscriber = /*@__PURE__*/ (/*@__PURE__*/ function (_super) {
  37. __extends(FinallySubscriber, _super);
  38. function FinallySubscriber(destination, callback) {
  39. _super.call(this, destination);
  40. this.add(new Subscription(callback));
  41. }
  42. return FinallySubscriber;
  43. }(Subscriber));
  44. //# sourceMappingURL=finalize.js.map