Skip to content

Commit

Permalink
Docs: Improve BackHandler documentation (addEventListener and removeE…
Browse files Browse the repository at this point in the history
…ventListener)

Summary:
This commit adds documentation to two methods of BackHandler API, addEventListener and removeEventListener. Despite being a simple change, it helps to keep the documentation consistent.

I have tested the `./website` locally, the changes look similar to some other components such as `NetInfo`.

[DOCS][ENHANCEMENT][BackHandler] - Improve BackHandler documentation (addEventListener and removeEventListener)
Closes facebook#16618

Differential Revision: D6260935

Pulled By: hramos

fbshipit-source-id: ab04a9fca89ddaa1925844b5754caf1c355a9329
  • Loading branch information
Adriano Melo authored and cdlewis committed Nov 19, 2017
1 parent 63d31f9 commit 21a3779
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Libraries/Utilities/BackHandler.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -84,6 +90,9 @@ var BackHandler = {
};
},

/**
* Removes the event handler.
*/
removeEventListener: function(
eventName: BackPressEventName,
handler: Function
Expand Down

0 comments on commit 21a3779

Please sign in to comment.