Moved timers into a plugin

This commit is contained in:
2022-07-28 02:52:31 +02:00
parent 227160e044
commit f67d5f6a2e
7 changed files with 198 additions and 171 deletions

View File

@@ -28,7 +28,6 @@
timerDoneUnlisten = listen<Timer>("timer-done", (event) => {
console.log("Done!", event.payload.id);
});
});
onDestroy(() => {
@@ -37,11 +36,11 @@
});
async function startTimer() {
let timer = await invoke<Timer>("make_timer", {
let timer = await invoke<Timer>("plugin:timers|make", {
duration: { secs: seconds, nanos: 0 },
message: "Hi!",
});
invoke("start_timer", { timerId: timer.id });
invoke("plugin:timers|start", { timerId: timer.id });
}
</script>