vikunja-frontend/src/composables/useNamespaceSearch.ts

20 lines
375 B
TypeScript
Raw Normal View History

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'
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,
}
}