feat: add dropdown to multiselect

This commit is contained in:
Xyphyn committed 2023-08-04 14:37:32 -07:00
1 parent af1bdf194c
commit dc1aba6c17
8 files changed
+107 -62

No files matched your search

+15
View File
@@ -1,4 +1,19 @@
import { goto } from '$app/navigation'
export const findClosestNumber = (numbers: number[], target: number): number =>
numbers.reduce((prev, curr) =>
Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev
)
export const searchParam = (
url: URL,
key: string,
value: string,
...deleteKeys: string[]
) => {
url.searchParams.set(key, value)
deleteKeys.forEach((k) => url.searchParams.delete(k))
goto(url, {
invalidateAll: true,
})
}