Skip to content

Commit

Permalink
Snapshot the Set of listeners registered to BackAndroid before dispat…
Browse files Browse the repository at this point in the history
…ching an event
  • Loading branch information
fabianeichinger committed Feb 6, 2016
1 parent 2f73ad0 commit 8403608
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Utilities/BackAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ type BackPressEventName = $Enum<{
var _backPressSubscriptions = new Set();

RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() {
var backPressSubscriptions = new Set(_backPressSubscriptions);
var invokeDefault = true;
_backPressSubscriptions.forEach((subscription) => {
backPressSubscriptions.forEach((subscription) => {
if (subscription()) {
invokeDefault = false;
}
Expand Down

0 comments on commit 8403608

Please sign in to comment.