Skip to content

Commit 541a6d0

Browse files
committed
throttling calls to pushes, pops etc
1 parent edf23bd commit 541a6d0

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Navigation.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ export default {
106106
registerScreen,
107107
getRegisteredScreen,
108108
registerComponent,
109-
showModal: _.throttle(showModal, 500, {leading: true, trailing: false}),
110-
dismissModal: _.throttle(dismissModal, 500, {leading: true, trailing: false}),
111-
dismissAllModals: _.throttle(dismissAllModals, 500, {leading: true, trailing: false}),
112-
showLightBox: _.throttle(showLightBox, 500, {leading: true, trailing: false}),
113-
dismissLightBox: _.throttle(dismissLightBox, 500, {leading: true, trailing: false}),
114-
showInAppNotification: _.throttle(showInAppNotification, 500, {leading: true, trailing: false}),
115-
dismissInAppNotification: _.throttle(dismissInAppNotification, 500, {leading: true, trailing: false}),
116-
startTabBasedApp: _.throttle(startTabBasedApp, 500, {leading: true, trailing: false}),
117-
startSingleScreenApp: _.throttle(startSingleScreenApp, 500, {leading: true, trailing: false})
109+
showModal: _.throttle(showModal, 1000, {leading: true, trailing: false}),
110+
dismissModal: dismissModal,
111+
dismissAllModals: dismissAllModals,
112+
showLightBox: _.throttle(showLightBox, 1000, {leading: true, trailing: false}),
113+
dismissLightBox: dismissLightBox,
114+
showInAppNotification: showInAppNotification,
115+
dismissInAppNotification: dismissInAppNotification,
116+
startTabBasedApp: _.throttle(startTabBasedApp, 1000, {leading: true, trailing: false}),
117+
startSingleScreenApp: _.throttle(startSingleScreenApp, 1000, {leading: true, trailing: false})
118118
};

src/Screen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import _ from 'lodash';
1111
const _allNavigatorEventHandlers = {};
1212

1313
const throttledPlatformSpecificFunctions = {
14-
push: _.throttle(platformSpecific.navigatorPush, 500, {leading: true, trailing: false}),
15-
pop: _.throttle(platformSpecific.navigatorPop, 500, {leading: true, trailing: false}),
16-
popToRoot: _.throttle(platformSpecific.navigatorPopToRoot, 500, {leading: true, trailing: false}),
17-
resetTo: _.throttle(platformSpecific.navigatorResetTo, 500, {leading: true, trailing: false})
14+
push: _.throttle(platformSpecific.navigatorPush, 1000, {leading: true, trailing: false}),
15+
pop: _.throttle(platformSpecific.navigatorPop, 100, {leading: true, trailing: false}),
16+
popToRoot: _.throttle(platformSpecific.navigatorPopToRoot, 100, {leading: true, trailing: false}),
17+
resetTo: _.throttle(platformSpecific.navigatorResetTo, 100, {leading: true, trailing: false})
1818
};
1919

2020
class Navigator {

0 commit comments

Comments
 (0)