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
.