const shortcuts = {
'n': () => console.log('Shortcut with "n" pressed'),
'na': () => console.log('Shortcut with "na" pressed')
};`
I have shortcut mapped like above but problem is when pressing n
then a
quickly then first shortcut mapped with n
gets called then shortcut mapped with na
gets called.
How can I change this so that only the na
shortcut is called in this case? When pressing n
then a
quickly then only shortcut mapped with na
should get called.
1