@micropermit/client-angular 0.2.9-beta.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -767,6 +767,7 @@
767
767
  _this.initialized = false;
768
768
  _this.serializeTo = LinkSerializer.AS_VALUE_IF_INITIALIZED;
769
769
  _this.intervalId = null;
770
+ _this.isRefreshing = false;
770
771
  if (initialized) {
771
772
  _this.set(initialValue);
772
773
  }
@@ -814,27 +815,54 @@
814
815
  };
815
816
  /**
816
817
  * @param {?=} interval
818
+ * @param {?=} errorHandler
817
819
  * @return {?}
818
820
  */
819
821
  LinkField.prototype.refresh = /**
820
822
  * @param {?=} interval
823
+ * @param {?=} errorHandler
821
824
  * @return {?}
822
825
  */
823
- function (interval) {
826
+ function (interval, errorHandler) {
824
827
  var _this = this;
825
828
  if (interval) {
826
829
  this.stopRefresh();
827
830
  }
828
- if (this.isInitialized()) {
829
- this.initWithObs().subscribe();
830
- }
831
+ /** @type {?} */
832
+ var resCb = (/**
833
+ * @return {?}
834
+ */
835
+ function () {
836
+ _this.isRefreshing = false;
837
+ });
838
+ this.isRefreshing = true;
839
+ this.initWithObs().subscribe(resCb, (/**
840
+ * @param {?} error
841
+ * @return {?}
842
+ */
843
+ function (error) {
844
+ resCb();
845
+ if (errorHandler) {
846
+ errorHandler(error);
847
+ }
848
+ }), resCb);
831
849
  if (interval) {
832
850
  this.intervalId = setInterval((/**
833
851
  * @return {?}
834
852
  */
835
853
  function () {
836
- if (_this.isInitialized()) {
837
- _this.initWithObs().subscribe();
854
+ if (!_this.isRefreshing) {
855
+ _this.isRefreshing = true;
856
+ _this.initWithObs().subscribe(resCb, (/**
857
+ * @param {?} error
858
+ * @return {?}
859
+ */
860
+ function (error) {
861
+ resCb();
862
+ if (errorHandler) {
863
+ errorHandler(error);
864
+ }
865
+ }), resCb);
838
866
  }
839
867
  }), interval);
840
868
  }
@@ -1048,6 +1076,11 @@
1048
1076
  * @private
1049
1077
  */
1050
1078
  LinkField.prototype.intervalId;
1079
+ /**
1080
+ * @type {?}
1081
+ * @private
1082
+ */
1083
+ LinkField.prototype.isRefreshing;
1051
1084
  }
1052
1085
 
1053
1086
  /**