Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: use EventName on window's once and remove listener before calling handler #10246

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

Legend-Master
Copy link
Contributor

  • Use EventName on Window, Webview and WebviewWindow's once
  • Unlisten before calling handler on once so we always unlisten the event even if the callback throws, also allow that unlisten's error to not get caught
  • Also refactored some other things

Copy link
Contributor Author

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that I don't think once on Window works with tauri://created and tauri://error, the handler is not removed after it gets called, I'm not familiar with how window specific event works, so I didn't fix that part

@Legend-Master Legend-Master marked this pull request as ready for review July 10, 2024 15:33
@Legend-Master Legend-Master requested a review from a team as a code owner July 10, 2024 15:33
@amrbashir amrbashir merged commit 080b6e1 into tauri-apps:dev Jul 10, 2024
11 checks passed
@Legend-Master Legend-Master deleted the refactor-js-event-api branch July 11, 2024 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants