2022-05-10 23:31:31 +00:00
|
|
|
import {ref, computed} from 'vue'
|
2022-09-02 09:15:29 +00:00
|
|
|
import {useNamespaceStore} from '@/stores/namespaces'
|
2022-04-25 17:38:57 +00:00
|
|
|
|
2022-09-02 09:15:29 +00:00
|
|
|
export function useNamespaceSearch() {
|
2022-04-25 17:38:57 +00:00
|
|
|
const query = ref('')
|
|
|
|
|
2022-09-02 09:15:29 +00:00
|
|
|
const namespaceStore = useNamespaceStore()
|
|
|
|
const namespaces = computed(() => namespaceStore.searchNamespace(query.value))
|
2022-04-25 17:38:57 +00:00
|
|
|
|
|
|
|
function findNamespaces(newQuery: string) {
|
|
|
|
query.value = newQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
namespaces,
|
|
|
|
findNamespaces,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|