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

Add method to remove all handlers #36

Merged
merged 3 commits into from
Jan 11, 2021
Merged

Add method to remove all handlers #36

merged 3 commits into from
Jan 11, 2021

Conversation

pvieito
Copy link
Contributor

@pvieito pvieito commented Jan 7, 2021

This is required if your keyboard shortcut names are dynamic (eg. they depend on user content) and you want to reset the handlers before re-creating them to avoid having multiple handlers for the same shortcut.

pvieito and others added 2 commits January 7, 2021 18:36
This is required if your keyboard shortcut names are dynamic (eg. they depend on user content) and you want to reset the handlers before re-creating them to avoid having multiple handlers for the same shortcut.
@@ -45,6 +45,16 @@ public enum KeyboardShortcuts {

// TODO: Should remove user defaults too.
}

/**
Remove all handlers receiving keyboard shortcuts events.
Copy link
Owner

Choose a reason for hiding this comment

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

Can you also document your use-case for it as mention in the PR description? It's not always clear to users what they would use something for and one or more use-cases can help them realize.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 👍🏻

@sindresorhus sindresorhus changed the title Added function to remove all handlers Add method to remove all handlers Jan 8, 2021
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.

None yet

2 participants