feat: expanded search for items (#46)

* expanded search for items

* range domain from email to example

* implement pagination for items
This commit is contained in:
Hayden 2022-10-12 21:13:07 -08:00 committed by GitHub
parent 1b20a69c5e
commit 30014a77ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 751 additions and 346 deletions

View file

@ -0,0 +1,32 @@
import { WritableComputedRef } from "vue";
export function useMinLoader(ms = 500): WritableComputedRef<boolean> {
const loading = ref(false);
const locked = ref(false);
const minLoading = computed({
get: () => loading.value,
set: value => {
if (value) {
loading.value = true;
if (!locked.value) {
locked.value = true;
setTimeout(() => {
locked.value = false;
}, ms);
}
}
if (!value && !locked.value) {
loading.value = false;
} else if (!value && locked.value) {
setTimeout(() => {
loading.value = false;
}, ms);
}
},
});
return minLoading;
}