-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!(global-shortcut): better APIs DX (#969)
* feat(global-shortcut): add `GlobalShortcutExt::register_with_handler` ref: #965 * clippy * refactor apis to take closure by default * change file * Update .changes/global-shortcut-refactor.md Co-authored-by: Simon Hyll <[email protected]> * Update global-shortcut-refactor.md * use option instead * clippy * update readme * on_shortcut and with_shortcut * map handler * simplify events * lint --------- Co-authored-by: Simon Hyll <[email protected]> Co-authored-by: Lucas Nogueira <[email protected]>
- Loading branch information
1 parent
644eb44
commit 62dafda
Showing
3 changed files
with
168 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"global-shortcut": "patch" | ||
--- | ||
|
||
**Breaking change** Refactored the plugin Rust APIs for better DX and flexibility: | ||
|
||
- Changed `Builder::with_handler` to be a method instead of a static method, it will also be triggered for any and all shortcuts even if the shortcut is registered through JS. | ||
- Added `Builder::with_shortcut` and `Builder::with_shortcuts` to register shortcuts on the plugin builder. | ||
- Added `on_shortcut` and `on_all_shortcuts` to register shortcuts with a handler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.