Add goToPrev, goToNext methods

This commit is contained in:
Vadim
2021-06-30 23:35:43 +03:00
parent 9cf1c645d3
commit 3cf4a3e7fe

View File

@@ -80,6 +80,20 @@
showPage(pageIndex + Number(infinite), { offsetDelayMs: 0, animated })
}
export function goToPrev(options) {
const animated = get(options, 'animated', true)
showPrevPage({
animated
})
}
export function goToNext(options) {
const animated = get(options, 'animated', true)
showNextPage({
animated
})
}
let store = createStore()
let currentPageIndex = 0
$: originalCurrentPageIndex = currentPageIndex - Number(infinite);