2022-05-11 01:31:31 +02:00
|
|
|
import {ref, computed} from 'vue'
|
2022-07-21 18:45:58 +02:00
|
|
|
import {useStore} from '@/store'
|
2022-04-25 19:38:57 +02:00
|
|
|
|
|
|
|
export function useNameSpaceSearch() {
|
|
|
|
const query = ref('')
|
|
|
|
|
|
|
|
const store = useStore()
|
|
|
|
const namespaces = computed(() => store.getters['namespaces/searchNamespace'](query.value))
|
|
|
|
|
|
|
|
function findNamespaces(newQuery: string) {
|
|
|
|
query.value = newQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
namespaces,
|
|
|
|
findNamespaces,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|