19 lines
404 B
JavaScript
19 lines
404 B
JavaScript
import {ref} from "vue";
|
|
|
|
|
|
export const paginationLimit = ref(10);
|
|
export const paginationOffset = ref(0);
|
|
|
|
export const filters = ref({});
|
|
|
|
export const loadPage = ({fetchFunc, appendItems}) => {
|
|
return fetchFunc({
|
|
...filters.value,
|
|
limit: paginationLimit.value,
|
|
offset: paginationOffset.value,
|
|
appendItems
|
|
}).then(() => {
|
|
paginationOffset.value += paginationLimit.value;
|
|
})
|
|
}
|