mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-09 19:42:48 +00:00
refactor: update to Svelte 5 preview
feat: add charrecorder feat: dynamic os layouts for CC1
This commit is contained in:
20
src/lib/charrecorder/TrackRollingWpm.svelte
Normal file
20
src/lib/charrecorder/TrackRollingWpm.svelte
Normal file
@@ -0,0 +1,20 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from "svelte";
|
||||
import { RollingWpmReplayPlugin } from "./core/plugins/rolling-wpm";
|
||||
import type { ReplayPlayer } from "./core/player";
|
||||
|
||||
const player: ReplayPlayer | undefined = getContext("replay");
|
||||
|
||||
let { wpm = $bindable(0) } = $props();
|
||||
|
||||
$effect(() => {
|
||||
if (!player) return;
|
||||
const tracker = new RollingWpmReplayPlugin();
|
||||
tracker.register(player);
|
||||
const unsubscribe = tracker.subscribe((value) => {
|
||||
wpm = value;
|
||||
});
|
||||
|
||||
return unsubscribe;
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user