2 ms·
This is just a heuristic to determine if the event is keydown or click. In the article the author says that the issue is that the same function is handling bot
by whstl 2y ago
This is just a heuristic to determine if the event is keydown or click.
In the article the author says that the issue is that the same function is handling both events, and they will work on refactoring it to something better.
The normal approach is just have different functions answering to different events. Or using more precise information about the event [1], instead of a heuristic.
[1] A suggestion was made by this poster: https://news.ycombinator.com/item?id=42174436 https://news.ycombinator.com/item?id=42174436