aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/index.umd.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-01 05:47:47 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-01 05:47:47 +0800
commite47dd4a83ed52dd246beddeb93fc5de3378fae24 (patch)
tree119eb20728e8ea4ab3910cf389db121b366821aa /packages/instant/src/index.umd.ts
parent9ebe8d63c829ea4b6b1fbbdf7a132c7f9b8f56dc (diff)
downloaddexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar.gz
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar.bz2
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar.lz
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar.xz
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.tar.zst
dexon-sol-tools-e47dd4a83ed52dd246beddeb93fc5de3378fae24.zip
chore: lint
Diffstat (limited to 'packages/instant/src/index.umd.ts')
-rw-r--r--packages/instant/src/index.umd.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/instant/src/index.umd.ts b/packages/instant/src/index.umd.ts
index 869b52353..3d7774858 100644
--- a/packages/instant/src/index.umd.ts
+++ b/packages/instant/src/index.umd.ts
@@ -89,11 +89,10 @@ export const render = (config: ZeroExInstantConfig, selector: string = DEFAULT_Z
// If the integrator defined a popstate handler, save it to __zeroExInstantIntegratorsPopStateHandler
// unless we have already done so on a previous render.
const anyWindow = window as any;
- if (window.onpopstate && !anyWindow.__zeroExInstantIntegratorsPopStateHandler) {
- anyWindow.__zeroExInstantIntegratorsPopStateHandler = window.onpopstate.bind(window);
- } else {
- anyWindow.__zeroExInstantIntegratorsPopStateHandler = util.boundNoop;
- }
+ const popStateExistsAndNotSetPreviously = window.onpopstate && !anyWindow.__zeroExInstantIntegratorsPopStateHandler;
+ anyWindow.__zeroExInstantIntegratorsPopStateHandler = popStateExistsAndNotSetPreviously
+ ? anyWindow.onpopstate.bind(window)
+ : util.boundNoop;
const onPopStateHandler = (e: PopStateEvent) => {
anyWindow.__zeroExInstantIntegratorsPopStateHandler(e);
const newState = e.state;