Skip to content

Commit

Permalink
Return objects with remove methods when subscribing to back or host s…
Browse files Browse the repository at this point in the history
…tate

Reviewed By: fkgozali

Differential Revision: D2907942

fb-gh-sync-id: 11666f2f8cd2432c42cc90bbf48ead02a75f8bc4
  • Loading branch information
sahrens authored and facebook-github-bot-9 committed Feb 6, 2016
1 parent cc92621 commit 8f6e074
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/Utilities/BackAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8f6e074

Please sign in to comment.