Skip to content

Conversation

@gastonfournier
Copy link
Contributor

About the changes

Gives users the ability to stop listening to events.

Closes #120

Implementation options

One alternative to this implementation was to return a cancellation/registration handle:

Instead of requiring callers to call removeUnleashEventListener(listener), addUnleashEventListener would return a lightweight registration object (Disposable/ListenerRegistration or a Job) that the caller cancels/disposes to stop that specific listener.

As a user, I think it's simpler to declare my listeners, attach them, and detach them at will, keeping a reference to them, rather than having to reference an object returned by the SDK.

Copy link
Member

@chriswk chriswk left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@github-project-automation github-project-automation bot moved this from New to Approved PRs in Issues and PRs Sep 5, 2025
@gastonfournier gastonfournier merged commit e724bf9 into main Sep 5, 2025
2 checks passed
@gastonfournier gastonfournier deleted the feat/ability-to-stop-listeners branch September 5, 2025 06:51
@github-project-automation github-project-automation bot moved this from Approved PRs to Done in Issues and PRs Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Missing "removeUnleashEventListener" to the existing "addUnleashEventListener"

2 participants