You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EventEmitter: Delete once() and removeCurrentListener()
Summary:
In an effort to simplify and clean up the `EventEmitter` abstractions in React Native, this removes `once()` and `removeCurrentListener()`. Across the Facebook codebase, there were only two callers of `once()` and no callers of `removeCurrentListener()`.
The same behavior can be achieved using:
```
const subscription = emitter.addListener('event', () => {
subscription.remove();
// ...
});
```
Changelog:
[General][Removed] - Removed `once()` and `removeCurrentListener()` fom `DeviceEventEmitter` and `NativeEventEmitter`.
Reviewed By: cpojer
Differential Revision: D22196474
fbshipit-source-id: 06ced186fd812e91d5c57f6580e647c100505807
0 commit comments