This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/composables/useNamespaceSearch.ts
Dominik Pschenitschni 093ab766d4
All checks were successful
continuous-integration/drone/pr Build is passing
feat: port namespace store to pinia
2022-09-21 23:32:21 +02:00

20 lines
401 B
TypeScript

import {ref, computed} from 'vue'
import {useNamespaceStore} from '@/stores/namespaces'
export function useNamespaceSearch() {
const query = ref('')
const namespaceStore = useNamespaceStore()
const namespaces = computed(() => namespaceStore.searchNamespace(query.value))
function findNamespaces(newQuery: string) {
query.value = newQuery
}
return {
namespaces,
findNamespaces,
}
}