Skip to main content

Type Alias: FilterOptions()

FilterOptions = (options, selectedFilters) => OptionSetOption[]

Function

Filters options based on selected filter criteria.

This method applies specified filters to a list of product options, returning only the options that match the filter criteria. This is useful for implementing custom filtering interfaces or for dynamically showing/hiding options based on user selections.

Parameters

options

OptionSetOption[]

Array of options to filter

selectedFilters

string[]

Array of filter IDs to apply

Returns

OptionSetOption[]

Filtered array of options that match the selected filters

Example

// Get all options
const allOptions = getOptionsFromSomewhere();

// Filter options by selected filters
const selectedFilters = ['${parentId}|${filterId}' , '${parentId1}|${filterId1}' ];
const filteredOptions = window.mimeeqApp.actions.filterOptions(allOptions, selectedFilters);

// Display the filtered options in a custom UI
displayOptionsInUI(filteredOptions);