MCPcopy Create free account
hub / github.com/Iduoad/Mrrakc / toggleFilter

Function toggleFilter

web/src/components/react/ExplorerMap.tsx:83–89  ·  view source on GitHub ↗
(list: string[], item: string, setter: (val: string[]) => void)

Source from the content-addressed store, hash-verified

81 }, [allPoints, searchQuery, selectedCategories, selectedProvinces, selectedTimePeriods, selectedPeople]);
82
83 const toggleFilter = (list: string[], item: string, setter: (val: string[]) => void) => {
84 if (list.includes(item)) {
85 setter(list.filter(i => i !== item));
86 } else {
87 setter([...list, item]);
88 }
89 };
90
91 // Specifically for category chips (toggle logic)
92 const toggleCategory = (category: string) => {

Callers 2

toggleCategoryFunction · 0.85
ExplorerMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected