@overmap-ai/core 1.0.48-component-type-views.2 → 1.0.48-component-type-views.4

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.
@@ -1641,16 +1641,14 @@ const selectComponentTypeFromComponents = (state) => {
1641
1641
  }
1642
1642
  return ret;
1643
1643
  };
1644
- const selectComponentsByType = (componentTypeId) => (state) => {
1645
- const components = state.componentReducer.components;
1646
- const componentsOfType = [];
1647
- for (const component of Object.values(components)) {
1648
- if (component.component_type === componentTypeId) {
1649
- componentsOfType.push(component);
1644
+ const selectComponentsByType = restructureCreateSelectorWithArgs(
1645
+ createSelector(
1646
+ [selectComponents, (_state, componentTypeId) => componentTypeId],
1647
+ (components, componentTypeId) => {
1648
+ return components.filter((component) => component.component_type === componentTypeId);
1650
1649
  }
1651
- }
1652
- return componentsOfType;
1653
- };
1650
+ )
1651
+ );
1654
1652
  const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1655
1653
  var _a2;
1656
1654
  if (!componentTypeId)