Move search to its own file, validate and search by nip05

This commit is contained in:
Jon Staab
2024-10-03 15:25:17 -07:00
parent 63761c91c8
commit d747424c28
6 changed files with 115 additions and 91 deletions
-9
View File
@@ -1,8 +1,6 @@
import {throttle} from 'throttle-debounce'
import {derived} from 'svelte/store'
import {inc} from '@welshman/lib'
import {custom} from '@welshman/store'
import {createSearch} from './util'
import {repository} from './core'
export type Topic = {
@@ -32,10 +30,3 @@ export const topics = custom<Topic[]>(setter => {
return () => repository.off("update", onUpdate)
})
export const topicSearch = derived(topics, $topics =>
createSearch($topics, {
getValue: (topic: Topic) => topic.name,
fuseOptions: {keys: ["name"]},
}),
)