Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/tiny-swiper/src/core/render/nextTick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ export type Tick = {
stop (): void
}

export const nextFrame = requestAnimationFrame || webkitRequestAnimationFrame || setTimeout
export const cancelNextFrame = cancelAnimationFrame || webkitCancelAnimationFrame || clearTimeout

export function Tick (): Tick {
let startTime: number | undefined
let id: number
const nextFrame = requestAnimationFrame || webkitRequestAnimationFrame || setTimeout
const cancelNextFrame = cancelAnimationFrame || webkitCancelAnimationFrame || clearTimeout

function run (cb: (interval: DOMHighResTimeStamp) => void): void {
// eslint-disable-next-line no-void
Expand Down
2 changes: 1 addition & 1 deletion packages/tiny-swiper/src/modules/breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { debounce } from '../core/render/timing'
import { Options, UserOptions } from '../core/options'
import { SwiperInstance, SwiperPlugin } from '../core/index'
import { LIFE_CYCLES } from '../core/eventHub'
import { nextFrame } from '../core/render/nextTick'

export type SwiperPluginBreakpointsInstance = {
update (): void
Expand All @@ -27,6 +26,7 @@ export default <SwiperPlugin>function SwiperPluginBreakpoints (
}
): void {
const isEnabled = Boolean(options.breakpoints)
const nextFrame = requestAnimationFrame || webkitRequestAnimationFrame || setTimeout
const breakpoints: SwiperPluginBreakpointsInstance = {
update (): void {

Expand Down