Skip to content

Commit 457cb21

Browse files
committed
fix(api): allow event payload arguments in onEvent helper to fix strict TS build
1 parent ce9e2c2 commit 457cb21

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { invoke } from '@tauri-apps/api/core'
22
import { listen } from '@tauri-apps/api/event'
33
import type { ElectronAPI, ReminderPayload } from './types'
44

5-
const onEvent = (name: string, callback: () => void) => {
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6+
const onEvent = (name: string, callback: (payload: any) => void) => {
67
let unlisten: (() => void) | undefined
78
let disposed = false
8-
listen(name, () => callback()).then((fn) => {
9+
listen(name, (event) => callback(event.payload)).then((fn) => {
910
if (disposed) {
1011
fn()
1112
return

0 commit comments

Comments
 (0)