monkey-front-core 0.0.467 → 0.0.469

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.
@@ -3166,14 +3166,20 @@ class MonkeyEcxCommonsResolveService extends MonkeyEcxCommonsService {
3166
3166
  return;
3167
3167
  const url = MonkeyEcxUtils.replaceVariables(route, { companyId });
3168
3168
  store.dispatch(action.load({ url, identifier }));
3169
- this.__data$ = store.select(selector.selectByIdentifier({ identifier }));
3170
3169
  this.__control$ = store.select(selector.selectControl());
3170
+ if (selector?.selectByIdentifier) {
3171
+ this.__data$ = store.select(selector.selectByIdentifier({ identifier }));
3172
+ }
3173
+ if (selector?.selectOneByIdentifier) {
3174
+ this.__data$ = store.select(selector.selectOneByIdentifier({ identifier }));
3175
+ }
3171
3176
  if (selector?.selectLinks) {
3172
3177
  this.__pagination$ = store.select(selector.selectLinks({ identifier }));
3173
3178
  }
3174
3179
  if (selector?.selectPage) {
3175
3180
  this.__page$ = store.select(selector.selectPage({ identifier }));
3176
3181
  }
3182
+ this.__onDataChanged$.next(null);
3177
3183
  }
3178
3184
  catch (e) {
3179
3185
  throw new Error(`MECX Core - Method getData -> ${e}`);
@@ -3186,8 +3192,8 @@ class MonkeyEcxCommonsResolveService extends MonkeyEcxCommonsService {
3186
3192
  store.dispatch(action.loadPagination({
3187
3193
  identifier: `${companyId || governmentId}-${companyType}`,
3188
3194
  pagination: {
3189
- action: 'next',
3190
- },
3195
+ action: 'next'
3196
+ }
3191
3197
  }));
3192
3198
  }
3193
3199
  catch (e) {
@@ -3247,8 +3253,8 @@ class MonkeyEcxCommonsResolveService extends MonkeyEcxCommonsService {
3247
3253
  const { router, currentRoute } = this;
3248
3254
  router.navigate([route || `${currentRoute}/details`], {
3249
3255
  state: {
3250
- detailsData,
3251
- },
3256
+ detailsData
3257
+ }
3252
3258
  });
3253
3259
  }
3254
3260
  catch (e) {
@@ -5567,10 +5573,16 @@ class MonkeyEcxCommonsSelectors {
5567
5573
  const selectAll = createSelector(selectState, reducer.selectAll);
5568
5574
  const selectByIdentifier = (props) => {
5569
5575
  return createSelector(selectAll, (entities) => {
5570
- const result = entities.filter((_) => {
5576
+ return entities.filter((_) => {
5571
5577
  return _.identifier === props.identifier;
5572
5578
  });
5573
- return result;
5579
+ });
5580
+ };
5581
+ const selectOneByIdentifier = (props) => {
5582
+ return createSelector(selectAll, (entities) => {
5583
+ return (entities.find((_) => {
5584
+ return _.identifier === props.identifier;
5585
+ }) || null);
5574
5586
  });
5575
5587
  };
5576
5588
  const selectControl = () => {
@@ -5617,6 +5629,7 @@ class MonkeyEcxCommonsSelectors {
5617
5629
  selectControl,
5618
5630
  selectLinks,
5619
5631
  selectByIdentifier,
5632
+ selectOneByIdentifier,
5620
5633
  selectPage,
5621
5634
  linksHasDifference
5622
5635
  };