Skip optional args

This commit is contained in:
Vadim
2021-07-15 19:08:39 +03:00
parent 8f2137b078
commit 211e390286

View File

@@ -77,21 +77,17 @@
if (typeof pageIndex !== 'number') { if (typeof pageIndex !== 'number') {
throw new Error('pageIndex should be a number') throw new Error('pageIndex should be a number')
} }
showPage(pageIndex + Number(infinite), { offsetDelayMs: 0, animated }) showPage(pageIndex + Number(infinite), { animated })
} }
export function goToPrev(options) { export function goToPrev(options) {
const animated = get(options, 'animated', true) const animated = get(options, 'animated', true)
showPrevPage({ showPrevPage({ animated })
animated
})
} }
export function goToNext(options) { export function goToNext(options) {
const animated = get(options, 'animated', true) const animated = get(options, 'animated', true)
showNextPage({ showNextPage({ animated })
animated
})
} }
let store = createStore() let store = createStore()
@@ -183,7 +179,7 @@
}) })
function handlePageChange(pageIndex) { function handlePageChange(pageIndex) {
showPage(pageIndex + Number(infinite), { offsetDelayMs: 0, animated: true }) showPage(pageIndex + Number(infinite))
} }
function offsetPage(animated) { function offsetPage(animated) {
@@ -246,7 +242,7 @@
offset += event.detail.dx offset += event.detail.dx
} }
function handleSwipeEnd() { function handleSwipeEnd() {
showPage(currentPageIndex, { offsetDelayMs: 0, animated: true }) showPage(currentPageIndex)
} }
function handleFocused(event) { function handleFocused(event) {
focused = event.detail.value focused = event.detail.value