How to use the ember-animated.clock.now function in ember-animated

To help you get started, we’ve selected a few ember-animated examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ember-animation / ember-animated / addon-test-support / time-control.js View on Github external
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) {
github ember-animation / ember-animated / addon-test-support / time-control.js View on Github external
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() {
github ember-animation / ember-animated / addon-test-support / time-control.js View on Github external
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() {