mirror of
https://gitlab.com/deeplydrumming/DeemixFix.git
synced 2026-01-16 17:02:57 -03:00
23 lines
362 B
JavaScript
23 lines
362 B
JavaScript
import { ref } from '@vue/composition-api'
|
|
import { fetchData } from '@/utils/api'
|
|
|
|
const result = ref({})
|
|
|
|
function performSearch ({ term, type, start = 0, nb = 30 }) {
|
|
fetchData('search', {
|
|
term,
|
|
type,
|
|
start,
|
|
nb
|
|
}).then(data => {
|
|
result.value = data
|
|
})
|
|
}
|
|
|
|
export function useSearch () {
|
|
return {
|
|
result,
|
|
performSearch
|
|
}
|
|
}
|