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

refactor(global-shortcut): enhance un/register to accept an array, remove un/registerAll #1117

Merged
merged 8 commits into from
Jul 8, 2024

Conversation

amrbashir
Copy link
Member

closes #1101

@amrbashir amrbashir requested a review from a team as a code owner March 26, 2024 15:51
@lucasfernog lucasfernog changed the title refactor(shell): enhance un/register to accept an array, remove un/registerAll refactor(global-shortcut): enhance un/register to accept an array, remove un/registerAll Mar 27, 2024
@lucasfernog
Copy link
Member

Should we do the same on the Rust side?

enum ShortcutArg {
  Single(T),
  List(Vec<T>),
}

impl From<T> for ShortcutArg { .. }
impl From<Vec<T>> for ShortcutArg { .. }

pub fn register(&self, shortcut: impl Into<ShortcutArg>) {...}

Also should it unregister all registered shortcuts if the list is empty (or we provide a separate API for that)?

@amrbashir
Copy link
Member Author

I don't think we should do the same on Rust, it is better to be kept as is.

Also should it unregister all registered shortcuts if the list is empty (or we provide a separate API for that)?

we could bring back unregisterAll I guess

Copy link
Contributor

github-actions bot commented Jul 8, 2024

Package Changes Through 307e2a7

There are 4 changes which include global-shortcut with prerelease, global-shortcut-js with prerelease, http-js with prerelease, os-js with prerelease

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.0-beta.12 2.0.0-beta.13
api-example-js 2.0.0-beta.10 2.0.0-beta.11
global-shortcut 2.0.0-beta.7 2.0.0-beta.8
global-shortcut-js 2.0.0-beta.6 2.0.0-beta.7
http-js 2.0.0-beta.7 2.0.0-beta.8
os-js 2.0.0-beta.6 2.0.0-beta.7

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars FabianLars requested a review from lucasfernog July 8, 2024 12:42
@amrbashir amrbashir merged commit 381a466 into v2 Jul 8, 2024
17 checks passed
@amrbashir amrbashir deleted the refactor/shell-js-apis branch July 8, 2024 16:20
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.

[global-shortcuts][v2] unregisterAll() fails as arguments not supplied
3 participants