Skip to content

Commit

Permalink
fix: attempt removing throttle dep
Browse files Browse the repository at this point in the history
  • Loading branch information
6eDesign committed Sep 18, 2021
1 parent ac1dabc commit d85b620
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/components/generic/KeyControls.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script>
import { KEY_CODES } from '$lib/config';
import { keyControlsContextKey } from '$lib/context';
import throttle from 'just-throttle';
import { getContext } from 'svelte';
export let limit = 0;
export let ctx = null;
const currentCtx = getContext(keyControlsContextKey);
Expand All @@ -15,7 +13,7 @@
if (mapping) mapping();
};
$: eventHandler = limit ? throttle(key, limit) : key;
$: eventHandler = key;
</script>

<svelte:window on:keydown={eventHandler} />
Expand Down

0 comments on commit d85b620

Please sign in to comment.