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

Remove deprecated removeSubscription from the type of NativeEventEmitter #39115

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,4 @@ declare class NativeEventEmitter extends EventEmitter {
* @param eventType name of the event whose registered listeners to remove
*/
removeAllListeners(eventType: string): void;

/**
* Removes a subscription created by the addListener, the EventSubscription#remove()
* function actually calls through to this.
*/
removeSubscription(subscription: EmitterSubscription): void;
}
2 changes: 0 additions & 2 deletions packages/react-native/types/__typetests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ const sub2 = androidEventEmitter.addListener(
androidEventEmitter.listenerCount('event'); // $ExpectType number
sub2.remove();
androidEventEmitter.removeAllListeners('event');
androidEventEmitter.removeSubscription(sub1);

// NativeEventEmitter - IOS
const nativeModule: NativeModule = {
Expand All @@ -1081,7 +1080,6 @@ const sub4 = iosEventEmitter.addListener('event', (event: object) => event, {});
iosEventEmitter.listenerCount('event');
sub4.remove();
iosEventEmitter.removeAllListeners('event');
iosEventEmitter.removeSubscription(sub3);

class CustomEventEmitter extends NativeEventEmitter {}

Expand Down