@micropermit/client-angular 0.2.8 → 0.2.9-beta.1
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.
- package/bundles/micropermit-client-angular.umd.js +71 -10
- package/bundles/micropermit-client-angular.umd.js.map +1 -1
- package/bundles/micropermit-client-angular.umd.min.js +1 -1
- package/bundles/micropermit-client-angular.umd.min.js.map +1 -1
- package/esm2015/lib/links/callablelink.js +1 -1
- package/esm2015/lib/links/linkfield.js +61 -12
- package/esm2015/lib/microclient.service.js +2 -2
- package/esm5/lib/links/callablelink.js +1 -1
- package/esm5/lib/links/linkfield.js +73 -12
- package/esm5/lib/microclient.service.js +2 -2
- package/fesm2015/micropermit-client-angular.js +61 -12
- package/fesm2015/micropermit-client-angular.js.map +1 -1
- package/fesm5/micropermit-client-angular.js +73 -12
- package/fesm5/micropermit-client-angular.js.map +1 -1
- package/lib/links/callablelink.d.ts +1 -1
- package/lib/links/linkfield.d.ts +6 -2
- package/lib/microclient.service.d.ts +1 -1
- package/micropermit-client-angular.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -766,6 +766,7 @@
|
|
|
766
766
|
var _this = _super.call(this, link, microClient, callParams, requestOptions) || this;
|
|
767
767
|
_this.initialized = false;
|
|
768
768
|
_this.serializeTo = LinkSerializer.AS_VALUE_IF_INITIALIZED;
|
|
769
|
+
_this.intervalId = null;
|
|
769
770
|
if (initialized) {
|
|
770
771
|
_this.set(initialValue);
|
|
771
772
|
}
|
|
@@ -812,17 +813,69 @@
|
|
|
812
813
|
return this._getPromise;
|
|
813
814
|
};
|
|
814
815
|
/**
|
|
816
|
+
* @param {?=} interval
|
|
815
817
|
* @return {?}
|
|
816
818
|
*/
|
|
817
|
-
LinkField.prototype.
|
|
819
|
+
LinkField.prototype.refresh = /**
|
|
820
|
+
* @param {?=} interval
|
|
821
|
+
* @return {?}
|
|
822
|
+
*/
|
|
823
|
+
function (interval) {
|
|
824
|
+
var _this = this;
|
|
825
|
+
if (interval) {
|
|
826
|
+
this.stopRefresh();
|
|
827
|
+
}
|
|
828
|
+
this.initWithObs();
|
|
829
|
+
if (interval) {
|
|
830
|
+
this.intervalId = setInterval((/**
|
|
831
|
+
* @return {?}
|
|
832
|
+
*/
|
|
833
|
+
function () {
|
|
834
|
+
_this.initWithObs().subscribe();
|
|
835
|
+
}), interval);
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
/**
|
|
839
|
+
* @return {?}
|
|
840
|
+
*/
|
|
841
|
+
LinkField.prototype.stopRefresh = /**
|
|
818
842
|
* @return {?}
|
|
819
843
|
*/
|
|
820
844
|
function () {
|
|
821
|
-
if (
|
|
822
|
-
this.
|
|
823
|
-
this._getPromise = null;
|
|
845
|
+
if (this.intervalId) {
|
|
846
|
+
clearInterval(this.intervalId);
|
|
824
847
|
}
|
|
825
|
-
|
|
848
|
+
};
|
|
849
|
+
/**
|
|
850
|
+
* @return {?}
|
|
851
|
+
*/
|
|
852
|
+
LinkField.prototype.listenObs = /**
|
|
853
|
+
* @return {?}
|
|
854
|
+
*/
|
|
855
|
+
function () {
|
|
856
|
+
var _this = this;
|
|
857
|
+
if (this.valueSubj) {
|
|
858
|
+
return this.valueSubj;
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
this.valueSubj = new rxjs.ReplaySubject(1);
|
|
862
|
+
return rxjs.defer((/**
|
|
863
|
+
* @return {?}
|
|
864
|
+
*/
|
|
865
|
+
function () {
|
|
866
|
+
_this.initWithObs(null, null).subscribe();
|
|
867
|
+
return _this.valueSubj;
|
|
868
|
+
}));
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
/**
|
|
872
|
+
* @return {?}
|
|
873
|
+
*/
|
|
874
|
+
LinkField.prototype.getObs = /**
|
|
875
|
+
* @return {?}
|
|
876
|
+
*/
|
|
877
|
+
function () {
|
|
878
|
+
return this.listenObs().pipe(operators.take(1));
|
|
826
879
|
};
|
|
827
880
|
/**
|
|
828
881
|
* @param {?} value
|
|
@@ -837,7 +890,10 @@
|
|
|
837
890
|
var oldValue = this.value;
|
|
838
891
|
this.value = value;
|
|
839
892
|
this.initialized = true;
|
|
840
|
-
|
|
893
|
+
if (!this.valueSubj) {
|
|
894
|
+
this.valueSubj = new rxjs.ReplaySubject(1);
|
|
895
|
+
}
|
|
896
|
+
this.valueSubj.next(value);
|
|
841
897
|
this._getPromise = null;
|
|
842
898
|
return oldValue;
|
|
843
899
|
};
|
|
@@ -859,7 +915,7 @@
|
|
|
859
915
|
function () {
|
|
860
916
|
this.value = null;
|
|
861
917
|
this.initialized = false;
|
|
862
|
-
this.
|
|
918
|
+
this.valueSubj = null;
|
|
863
919
|
this._getPromise = null;
|
|
864
920
|
};
|
|
865
921
|
/**
|
|
@@ -975,14 +1031,19 @@
|
|
|
975
1031
|
* @type {?}
|
|
976
1032
|
* @private
|
|
977
1033
|
*/
|
|
978
|
-
LinkField.prototype.
|
|
1034
|
+
LinkField.prototype._getPromise;
|
|
979
1035
|
/**
|
|
980
1036
|
* @type {?}
|
|
981
1037
|
* @private
|
|
982
1038
|
*/
|
|
983
|
-
LinkField.prototype.
|
|
1039
|
+
LinkField.prototype.valueSubj;
|
|
984
1040
|
/** @type {?} */
|
|
985
1041
|
LinkField.prototype.serializeTo;
|
|
1042
|
+
/**
|
|
1043
|
+
* @type {?}
|
|
1044
|
+
* @private
|
|
1045
|
+
*/
|
|
1046
|
+
LinkField.prototype.intervalId;
|
|
986
1047
|
}
|
|
987
1048
|
|
|
988
1049
|
/**
|
|
@@ -1588,7 +1649,7 @@
|
|
|
1588
1649
|
* @return {?}
|
|
1589
1650
|
*/
|
|
1590
1651
|
function (val) {
|
|
1591
|
-
return
|
|
1652
|
+
return MicroObject.fromObject(val, _this);
|
|
1592
1653
|
})), this.catchAndHandleError());
|
|
1593
1654
|
return httpObs;
|
|
1594
1655
|
};
|