Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9f4e434

Browse files
committed
Wire up electron download progress to toasts
1 parent ae5b6ef commit 9f4e434

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/hooks/useEventEmitter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ limitations under the License.
1515
*/
1616

1717
import {useRef, useEffect} from "react";
18-
import type {EventEmitter} from "events";
1918

2019
type Handler = (...args: any[]) => void;
2120

21+
interface EventEmitter {
22+
on(event: string | symbol, listener: (...args: any[]) => void);
23+
removeListener(event: string | symbol, listener: (...args: any[]) => void);
24+
}
25+
2226
// Hook to wrap event emitter on and removeListener in hook lifecycle
2327
export const useEventEmitter = (emitter: EventEmitter, eventName: string | symbol, handler: Handler) => {
2428
// Create a ref that stores handler

0 commit comments

Comments
 (0)