Ver Fonte

feat: limit key fps on development as it's slower

Fela Maslen há 5 anos atrás
pai
commit
8a376f77d5
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      gmus-web/src/hooks/vim.ts

+ 5 - 1
gmus-web/src/hooks/vim.ts

@@ -49,7 +49,11 @@ export function useVimBindings(dispatch: Dispatch<ActionKeyPressed>, skip = fals
     [dispatch],
   );
 
-  const listenerThrottled = useThrottleCallback(listener, 60, true);
+  const listenerThrottled = useThrottleCallback(
+    listener,
+    process.env.NODE_ENV === 'development' ? 15 : 60,
+    true,
+  );
 
   useEffect(() => {
     if (skip) {