Zulko / eagle.js

A hackable slideshow framework built with Vue.js
https://zulko.github.io/eaglejs-demo/
ISC License
4.08k stars 222 forks source link

#6 added throttling for Mac touchpad #8

Closed vittorio closed 6 years ago

vittorio commented 7 years ago

You need to play with throttling time. 1000 – it's good for Mac but i'm not sure about other devices. If you don't want to have lodash as dependency you can just clone one throttle method from that. It's just quick fix for #6 :)

Zulko commented 7 years ago

shouldn't it be debounce instead of throttle ? From what i understand, throttle will still perform all events, just space them, while debounce will discard the events after the first.

vittorio commented 7 years ago

@Zulko, sorry for silence. Will try to play with it in next few days

QuentinRoy commented 7 years ago

Actually, usual throttle implementations do not perform all events. They will discard any events happening within a window of x ms after the previous passed event. But I agree that debounce might be more appropriate here. However debounce usually triggers a function after it has not been called for x amount of time. In this case it might be a bit annoying as it would slow down the interaction. We might want to be sure it is called on the "leading edge of the timeout", (option leading with lodash's debounce).

yaodingyd commented 6 years ago

Fixed with bd14f5b and 0d771b3