[new feature] Swipe: add immediate option of swipeTo method (#3821)

This commit is contained in:
neverland
2019-07-11 16:09:20 +08:00
committed by GitHub
parent 734c3259d8
commit 3c9dc4edfe
6 changed files with 52 additions and 14 deletions
+7
View File
@@ -28,6 +28,13 @@ export function raf(fn: FrameRequestCallback): number {
return iRaf.call(root, fn);
}
// double raf for animation
export function doubleRaf(fn: FrameRequestCallback): void {
raf(() => {
raf(fn);
});
}
export function cancelRaf(id: number) {
iCancel.call(root, id);
}