Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// root url should fallback to 'currentGame'
if (route === '/') history.push(`/${currentGame.route}`);
// go to it for the first time only if game actually exists
if (gamesData.find(g => g.route === getCleanRoute(route))) {
goToRequestedGame(route);
}
// save the current redux state for ssr
this.firstReduxState = store.getState();
// make throttled methods
const SCROLL_TRIGGER_THRESHOLD = 10; // ms
this._throttledHandleScroll = throttle(this._handleScroll, SCROLL_TRIGGER_THRESHOLD, true);
}
constructor (props, context) {
super(props, context)
const intervalValue = typeof interval === 'function' ? interval(props) : interval
this.throttlePropInvoke = throttle(
(...args) => this.props[handlerName](...args),
intervalValue,
leadingCall
)
this.handler = (e, ...rest) => {
if (e && typeof e.persist === 'function') {
e.persist()
}
return this.throttlePropInvoke(e, ...rest)
}
}
delete query[key]
} else if (typeof patch[key] === 'boolean' && patch[key] === false) {
delete query[key]
}
}
if (this.hasFilters) {
this.$router.replace({
query,
})
} else {
this.$router.push({
query,
})
}
},
handleScroll: throttle(function ({ target }) {
this.scrollTop = {
last: this.scrollTop.current,
current: target.scrollTop,
}
}, 200),
scrollToTop () {
this.$refs.main.scrollTop()
},
},
components: {
TypeCapsule,
Iconfont,
},
}