NoriginMedia / react-spatial-navigation

DEPRECATED. HOC-based Spatial Navigation. NEW Hooks version is available here: https://github.com/NoriginMedia/norigin-spatial-navigation
MIT License
226 stars 64 forks source link

Allow throttle for key pressing #67

Closed JakubKubista closed 4 years ago

JakubKubista commented 4 years ago

Issue

Changed

predikament commented 4 years ago

I am not entirely understanding the purpose of this, could you please explain it a bit more?

predikament commented 4 years ago

Never mind, if I understand it correctly you want to be able to throttle individual keypresses too.

asgvard commented 4 years ago

I agree that the wording is not very clear. Also this new feature needs to be mentioned in README docs. The naming for this param should be something prefixed by “is” to make it intuitive that it is a bool, but something different from the current name. Let’s think about it tomorrow 🙂

predikament commented 4 years ago

.. param should be something prefixed by “is” ..

I was going to suggest the same, but then I noticed we already have these:

this.enabled = false;
this.nativeMode = false;
this.paused = false;
this.debug = false;

But I think the linting rule usually prefers is* / has* as you said, so I guess that's the way to go. 👍

asgvard commented 4 years ago

Oh, I didn’t check old flags names, indeed we don’t really follow this rule. But still, we should name it somehow differently. Hardest part..

asgvard commented 4 years ago

Ok, I think throttleKeypresses sounds good. It means that it throttles all key presses, and not only press Down like it was by default. And please also update README about this new flag.