From 622d6a8ff6a11389f89af9f17e404b8f32ca60ea Mon Sep 17 00:00:00 2001 From: Adriano Melo Date: Wed, 1 Nov 2017 00:07:47 +0100 Subject: [PATCH] Docs: Improve BackHandler documentation (addEventListener and removeEventListener) --- Libraries/Utilities/BackHandler.android.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Libraries/Utilities/BackHandler.android.js b/Libraries/Utilities/BackHandler.android.js index 21e320c5e457a1..e9ccd1a5809390 100644 --- a/Libraries/Utilities/BackHandler.android.js +++ b/Libraries/Utilities/BackHandler.android.js @@ -74,6 +74,12 @@ var BackHandler = { DeviceEventManager.invokeDefaultBackPressHandler(); }, + /** + * Adds an event handler. Supported events: + * + * - `hardwareBackPress`: Fires when the Android hardware back button is pressed or when the + * tvOS menu button is pressed. + */ addEventListener: function ( eventName: BackPressEventName, handler: Function @@ -84,6 +90,9 @@ var BackHandler = { }; }, + /** + * Removes the event handler. + */ removeEventListener: function( eventName: BackPressEventName, handler: Function