Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onVisitorLoggerChange = (e: *) => {
Visitors.remove(inspectorVisitorLogger);
if (e.target.checked) {
Visitors.add(inspectorVisitorLogger);
}
};
componentDidMount() {
Visitors.add(this);
this._startupTimeout = setTimeout(() => this.detectSurface(), 0);
let lastT;
const loop = t => {
this._raf = raf(loop);
if (!lastT) lastT = t;
const delta = Math.min(100, t - lastT);
lastT = t;
const syncChanged = this.syncFromDom();
const physicsChanged = this.state.physics && this.physicsStep(delta);
if (syncChanged || physicsChanged) {
this.forceUpdate();
}
};
this._raf = raf(loop);
}