1 parent ce9e2c2 commit 457cb21Copy full SHA for 457cb21
1 file changed
src/api.ts
@@ -2,10 +2,11 @@ import { invoke } from '@tauri-apps/api/core'
2
import { listen } from '@tauri-apps/api/event'
3
import type { ElectronAPI, ReminderPayload } from './types'
4
5
-const onEvent = (name: string, callback: () => void) => {
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+const onEvent = (name: string, callback: (payload: any) => void) => {
7
let unlisten: (() => void) | undefined
8
let disposed = false
- listen(name, () => callback()).then((fn) => {
9
+ listen(name, (event) => callback(event.payload)).then((fn) => {
10
if (disposed) {
11
fn()
12
return
0 commit comments