All files / app/src/features/measure/lib set-measure-filter-value.tsx

7.69% Statements 1/13
100% Branches 0/0
0% Functions 0/1
7.69% Lines 1/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18        1x                          
import { Nullable, SelectOption } from '@/shared/@types'
import { MeasureFilterAtomType } from '@/features/measure'
import { SetStateAction } from 'jotai'
 
export const setMeasureFilterValue = (
  setFilterValue: (value: SetStateAction<Nullable<MeasureFilterAtomType>>) => void,
  field: string,
  filterValue?: Nullable<SelectOption | SelectOption[]>
) => {
  setFilterValue(
    prev =>
      ({
        ...prev,
        [field]: filterValue,
      } as MeasureFilterAtomType)
  )
}