|
148 | 148 | }: Props = $props() |
149 | 149 |
|
150 | 150 | // Pull the setters from the injected state instance so the template reads |
151 | | - // `setSizeFilter(...)` like before. Local consts (not re-exports) so the component stays |
152 | | - // self-contained; the underlying writes still go through the instance the consumer owns. |
153 | | - const setSizeFilter = filterState.setSizeFilter |
154 | | - const setSizeValue = filterState.setSizeValue |
155 | | - const setSizeUnit = filterState.setSizeUnit |
156 | | - const setSizeValueMax = filterState.setSizeValueMax |
157 | | - const setSizeUnitMax = filterState.setSizeUnitMax |
158 | | - const setDateFilter = filterState.setDateFilter |
159 | | - const setDateValue = filterState.setDateValue |
160 | | - const setDateValueMax = filterState.setDateValueMax |
161 | | - const setQueryFromUserInput = filterState.setQueryFromUserInput |
| 151 | + // `setSizeFilter(...)` like before. Arrow-function wrappers (not raw method refs) keep |
| 152 | + // `this` binding intact and silence `@typescript-eslint/unbound-method` since the |
| 153 | + // factory's setters don't read `this` but the type system can't prove it. |
| 154 | + const setSizeFilter: typeof filterState.setSizeFilter = (v) => { filterState.setSizeFilter(v); } |
| 155 | + const setSizeValue: typeof filterState.setSizeValue = (v) => { filterState.setSizeValue(v); } |
| 156 | + const setSizeUnit: typeof filterState.setSizeUnit = (v) => { filterState.setSizeUnit(v); } |
| 157 | + const setSizeValueMax: typeof filterState.setSizeValueMax = (v) => { filterState.setSizeValueMax(v); } |
| 158 | + const setSizeUnitMax: typeof filterState.setSizeUnitMax = (v) => { filterState.setSizeUnitMax(v); } |
| 159 | + const setDateFilter: typeof filterState.setDateFilter = (v) => { filterState.setDateFilter(v); } |
| 160 | + const setDateValue: typeof filterState.setDateValue = (v) => { filterState.setDateValue(v); } |
| 161 | + const setDateValueMax: typeof filterState.setDateValueMax = (v) => { filterState.setDateValueMax(v); } |
| 162 | + const setQueryFromUserInput: typeof filterState.setQueryFromUserInput = (v) => { filterState.setQueryFromUserInput(v); } |
162 | 163 |
|
163 | 164 | let openChip = $state<FilterKey | 'add' | null>(null) |
164 | 165 |
|
|
0 commit comments