mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 02:04:55 +00:00
Return objects with remove methods when subscribing to back or host state
Reviewed By: fkgozali Differential Revision: D2907942 fb-gh-sync-id: 11666f2f8cd2432c42cc90bbf48ead02a75f8bc4
This commit is contained in:
parent
cc926211b6
commit
8f6e074bd6
@ -59,8 +59,11 @@ var BackAndroid = {
|
||||
addEventListener: function (
|
||||
eventName: BackPressEventName,
|
||||
handler: Function
|
||||
): void {
|
||||
): {remove: () => void} {
|
||||
_backPressSubscriptions.add(handler);
|
||||
return {
|
||||
remove: () => BackAndroid.removeEventListener(eventName, handler),
|
||||
};
|
||||
},
|
||||
|
||||
removeEventListener: function(
|
||||
|
Loading…
x
Reference in New Issue
Block a user