monkey-front-core 0.0.84 → 0.0.85

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.
@@ -1797,9 +1797,12 @@ class MonkeyEcxCommonsService {
1797
1797
  this.__onZipCodeDataChanged$ = new BehaviorSubject(null);
1798
1798
  this.__oni18nDataChanged$ = new BehaviorSubject(null);
1799
1799
  this.__onDoSearch$ = new BehaviorSubject({});
1800
- this.__onDoPagination$ = new BehaviorSubject(null);
1801
1800
  this.__tokenCredentials = null;
1802
1801
  this.__schedule = null;
1802
+ this.callbackPagination = () => {
1803
+ // eslint-disable-next-line no-console
1804
+ return console.error('Method callbackPagination needs to be declared');
1805
+ };
1803
1806
  this.handleInit();
1804
1807
  }
1805
1808
  handleInit() {
@@ -1950,24 +1953,13 @@ class MonkeyEcxCommonsService {
1950
1953
  },
1951
1954
  });
1952
1955
  }
1953
- if (otherArgs?.callbackPagination) {
1954
- this.__onDoPagination$.subscribe(() => {
1955
- if (!this.__onLoadingInProgress$.value) {
1956
- const hasMorePages = this.setPage({
1957
- page: {
1958
- ...this.__page,
1959
- },
1960
- }).nextPage();
1961
- if (hasMorePages && otherArgs?.callbackPagination) {
1962
- otherArgs.callbackPagination();
1963
- }
1964
- }
1965
- });
1966
- }
1967
1956
  if (otherArgs?.translateOptions) {
1968
1957
  const { service, keys } = otherArgs?.translateOptions;
1969
1958
  this.geti18n(service, keys || '');
1970
1959
  }
1960
+ if (otherArgs?.callbackPagination) {
1961
+ this.callbackPagination = otherArgs.callbackPagination;
1962
+ }
1971
1963
  if (otherArgs?.feature) {
1972
1964
  const { flag, service } = otherArgs.feature;
1973
1965
  service.onFlags
@@ -2016,6 +2008,18 @@ class MonkeyEcxCommonsService {
2016
2008
  this.__oni18nDataChanged$.next(null);
2017
2009
  });
2018
2010
  }
2011
+ doPagination() {
2012
+ if (!this.__onLoadingInProgress$.value) {
2013
+ const hasMorePages = this.setPage({
2014
+ page: {
2015
+ ...this.__page,
2016
+ },
2017
+ }).nextPage();
2018
+ if (hasMorePages && this.callbackPagination) {
2019
+ this.callbackPagination();
2020
+ }
2021
+ }
2022
+ }
2019
2023
  }
2020
2024
  __decorate([
2021
2025
  MonkeyEcxCoreService({