Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { clock, rAF } from 'ember-animated';
let origNow = clock.now;
export default class TimeControl {
constructor() {
if (clock.now !== origNow) {
throw new Error("Only one TimeControl may be active at a time");
}
this._timer = origNow();
this._runningSpeed = false;
this._runStartedAt = null;
clock.now = () => this.now();
}
finished() {
clock.now = origNow;
}
now() {
if (this._runningSpeed) {
constructor() {
if (clock.now !== origNow) {
throw new Error("Only one TimeControl may be active at a time");
}
this._timer = origNow();
this._runningSpeed = false;
this._runStartedAt = null;
clock.now = () => this.now();
}
finished() {
constructor() {
if (clock.now !== origNow) {
throw new Error("Only one TimeControl may be active at a time");
}
this._timer = origNow();
this._runningSpeed = false;
this._runStartedAt = null;
clock.now = () => this.now();
}
finished() {