ngx-bootstrap-mini-ngrx.umd.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators')) :
  3. typeof define === 'function' && define.amd ? define('ngx-bootstrap/mini-ngrx', ['exports', 'rxjs', 'rxjs/operators'], factory) :
  4. (global = global || self, factory((global['ngx-bootstrap'] = global['ngx-bootstrap'] || {}, global['ngx-bootstrap']['mini-ngrx'] = {}), global.rxjs, global.rxjs.operators));
  5. }(this, function (exports, rxjs, operators) { 'use strict';
  6. /*! *****************************************************************************
  7. Copyright (c) Microsoft Corporation. All rights reserved.
  8. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  9. this file except in compliance with the License. You may obtain a copy of the
  10. License at http://www.apache.org/licenses/LICENSE-2.0
  11. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  13. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  14. MERCHANTABLITY OR NON-INFRINGEMENT.
  15. See the Apache Version 2.0 License for specific language governing permissions
  16. and limitations under the License.
  17. ***************************************************************************** */
  18. /* global Reflect, Promise */
  19. var extendStatics = function(d, b) {
  20. extendStatics = Object.setPrototypeOf ||
  21. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  22. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23. return extendStatics(d, b);
  24. };
  25. function __extends(d, b) {
  26. extendStatics(d, b);
  27. function __() { this.constructor = d; }
  28. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  29. }
  30. /**
  31. * @fileoverview added by tsickle
  32. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  33. */
  34. /**
  35. * @template T
  36. */
  37. var /**
  38. * @template T
  39. */
  40. MiniState = /** @class */ (function (_super) {
  41. __extends(MiniState, _super);
  42. function MiniState(_initialState, actionsDispatcher$, reducer) {
  43. var _this = _super.call(this, _initialState) || this;
  44. /** @type {?} */
  45. var actionInQueue$ = actionsDispatcher$.pipe(operators.observeOn(rxjs.queueScheduler));
  46. /** @type {?} */
  47. var state$ = actionInQueue$.pipe(operators.scan((/**
  48. * @param {?} state
  49. * @param {?} action
  50. * @return {?}
  51. */
  52. function (state, action) {
  53. if (!action) {
  54. return state;
  55. }
  56. return reducer(state, action);
  57. }), _initialState));
  58. state$.subscribe((/**
  59. * @param {?} value
  60. * @return {?}
  61. */
  62. function (value) { return _this.next(value); }));
  63. return _this;
  64. }
  65. return MiniState;
  66. }(rxjs.BehaviorSubject));
  67. /**
  68. * @fileoverview added by tsickle
  69. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  70. */
  71. /**
  72. * @template T
  73. */
  74. var /**
  75. * @template T
  76. */
  77. MiniStore = /** @class */ (function (_super) {
  78. __extends(MiniStore, _super);
  79. function MiniStore(_dispatcher, _reducer,
  80. /* tslint:disable-next-line: no-any */
  81. state$) {
  82. var _this = _super.call(this) || this;
  83. _this._dispatcher = _dispatcher;
  84. _this._reducer = _reducer;
  85. /* tslint:disable-next-line: deprecation */
  86. _this.source = state$;
  87. return _this;
  88. }
  89. /**
  90. * @template R
  91. * @param {?} pathOrMapFn
  92. * @return {?}
  93. */
  94. MiniStore.prototype.select = /**
  95. * @template R
  96. * @param {?} pathOrMapFn
  97. * @return {?}
  98. */
  99. function (pathOrMapFn) {
  100. /* tslint:disable-next-line: deprecation */
  101. /** @type {?} */
  102. var mapped$ = this.source.pipe(operators.map(pathOrMapFn));
  103. return mapped$.pipe(operators.distinctUntilChanged());
  104. };
  105. /**
  106. * @template R
  107. * @param {?} operator
  108. * @return {?}
  109. */
  110. MiniStore.prototype.lift = /**
  111. * @template R
  112. * @param {?} operator
  113. * @return {?}
  114. */
  115. function (operator) {
  116. /** @type {?} */
  117. var store = new MiniStore(this._dispatcher, this._reducer, this);
  118. /* tslint:disable-next-line: deprecation */
  119. store.operator = operator;
  120. return store;
  121. };
  122. /**
  123. * @param {?} action
  124. * @return {?}
  125. */
  126. MiniStore.prototype.dispatch = /**
  127. * @param {?} action
  128. * @return {?}
  129. */
  130. function (action) {
  131. this._dispatcher.next(action);
  132. };
  133. /**
  134. * @param {?} action
  135. * @return {?}
  136. */
  137. MiniStore.prototype.next = /**
  138. * @param {?} action
  139. * @return {?}
  140. */
  141. function (action) {
  142. this._dispatcher.next(action);
  143. };
  144. /* tslint:disable-next-line: no-any */
  145. /* tslint:disable-next-line: no-any */
  146. /**
  147. * @param {?} err
  148. * @return {?}
  149. */
  150. MiniStore.prototype.error = /* tslint:disable-next-line: no-any */
  151. /**
  152. * @param {?} err
  153. * @return {?}
  154. */
  155. function (err) {
  156. this._dispatcher.error(err);
  157. };
  158. /**
  159. * @return {?}
  160. */
  161. MiniStore.prototype.complete = /**
  162. * @return {?}
  163. */
  164. function () {
  165. /*noop*/
  166. };
  167. return MiniStore;
  168. }(rxjs.Observable));
  169. exports.MiniState = MiniState;
  170. exports.MiniStore = MiniStore;
  171. Object.defineProperty(exports, '__esModule', { value: true });
  172. }));
  173. //# sourceMappingURL=ngx-bootstrap-mini-ngrx.umd.js.map