Skip to content

Conversation

@joshnies
Copy link

Adds the following methods for removing only the handlers for specific Names:

/**
Remove all handlers for one or more names. Includes both "key down" and "key up" handlers.
*/
public static func removeHandlers(for names: [Name]) {}

/**
Remove all "key down" handlers for one or more names.
*/
public static func removeKeyDownHandlers(for names: [Name]) {}

/**
Remove all "key up" handlers for one or more names.
*/
public static func removeKeyUpHandlers(for names: [Name]) {}

NOTE: I also made legacyKeyDownHandlers and legacyKeyUpHandlers internal for testing purposes.

@sindresorhus
Copy link
Owner

I'm not sure it makes sense to add these methods as onKeyDown/onKeyUp are legacy and will be deprecated in the future. The recommended API is .events() which does not need this.

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