vikunja-frontend/src/composables/useNamespaceSearch.ts
2022-09-05 17:43:23 +02:00

19 lines
375 B
TypeScript

import {ref, computed} from 'vue'
import {useStore} from '@/store'
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,
}
}