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

Unify event architecture between api and keystore #489

Open
wants to merge 3 commits into
base: session-issues
Choose a base branch
from

Conversation

emlun
Copy link
Member

@emlun emlun commented Dec 6, 2024

With #483, the api and LocalStorageKeystore modules now expose two very different ways of attaching event listeners to these services. This PR aims to unify both APIs under a shared architecture based on the EventTarget type available in the JS engine.

As part of that, this also introduces util.cleanupListeners to help streamline setting up useEffect cleanup handlers to remove stale event listeners. This helper function sets up an AbortController and provides its signal so that event listeners can be automatically removed using the signal option of addEventListener.

@emlun emlun requested a review from gkatrakazas December 6, 2024 16:34
@emlun emlun mentioned this pull request Dec 6, 2024
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.

1 participant