Skip to content

Commit

Permalink
fix listener
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsolomou committed Dec 3, 2023
1 parent 1cc966e commit 8b1774f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ export const tarrasque = {
* });
* unregisterListener();
*/
_listen(callback: (event: MessageEvent) => () => unknown): () => void {
_listen(callback: (message: MessageEvent['data']) => () => unknown): () => void {
// Listen for messages from child windows
const listener = (event: MessageEvent) => {
const message = event.data;
const message = event.data as { event: string; data?: unknown };
if (!message.event) return;

// Run the callback to get the event handler
Expand Down

0 comments on commit 8b1774f

Please sign in to comment.