Skip to content

Conversation

@retyui
Copy link
Contributor

@retyui retyui commented Jan 20, 2026

Summary:

issue: #55246

TODO:

  • Do Runtime testing
  • Update TS types

Changelog:

[GENERAL] [ADDED] - Allow to pass options to addEventListener(type, listener, {once, signal}) method

Test Plan:

AppState.addEventListener('change', listener, { once: true }); 
// ^^^ auto cleanup a listener after dispatching  1st event  

AppState.addEventListener('change', listener, { signal: AbortSignal.timeout(5000) }); 
// ^^^ auto cleanup a listener after 5s

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 20, 2026
@retyui retyui marked this pull request as draft January 20, 2026 19:33
@retyui retyui changed the title Draft: feat: Make (AppState, AccessibilityInfo, Linking, BackHandler, Dimensions) EventTarget like feat: Make (AppState, AccessibilityInfo, Linking, BackHandler, Dimensions) EventTarget like Jan 20, 2026

// Remove subscription if the abort signal is triggered
if (abortSignal) {
abortSignal.addEventListener(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: add cleanup for this listener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants