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

WatcherImpl may have a detach method #5

Open
PackRuble opened this issue Dec 3, 2023 · 0 comments
Open

WatcherImpl may have a detach method #5

PackRuble opened this issue Dec 3, 2023 · 0 comments
Labels
discussion There's a lot to discuss enhancement New feature or request

Comments

@PackRuble
Copy link
Owner

I see this as introducing two possible methods:

  • detach(Card) - will remove all listeners for this card
  • detachAll() - will remove all listeners for all cards altogether

At the moment, there is no way to implement the removal of a specific callback tied to a specific card. The opinion is based on the technical implementation of WatcherImpl.

For what?
It might be worth considering some use cases:

  • you don't use detacher (perhaps because of its implementation, which is not convenient for all cases) in the attach method and want to delete [all] callbacks yourself later
  • you don't need to remove callbacks. Your application adds them once and uses them after until you close the application.

This would also require making detacher a nulable-type (but probably still required)

@PackRuble PackRuble added enhancement New feature or request discussion There's a lot to discuss labels Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion There's a lot to discuss enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant