Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* jshint newcap: false */
import Promise from "./promise";
import Ember from "ember";
import Velocity from "velocity";
// Make sure Velocity always has promise support by injecting our own
// RSVP-based implementation if it doesn't already have one.
if (!Velocity.Promise) {
Velocity.Promise = Promise;
}
export function animate(elt, props, opts, label) {
// These numbers are just sane defaults in the probably-impossible
// case where somebody tries to read our state before the first
// 'progress' callback has fired.
var state = { percentComplete: 0, timeRemaining: 100, timeSpent: 0 };
if (!elt || elt.length === 0) {
return Promise.resolve();
}
if (!opts) {
opts = {};
} else {
/* jshint newcap: false */
import Promise from "./promise";
import Ember from "ember";
import Velocity from "velocity";
// Make sure Velocity always has promise support by injecting our own
// RSVP-based implementation if it doesn't already have one.
if (!Velocity.Promise) {
Velocity.Promise = Promise;
}
export function animate(elt, props, opts, label) {
// These numbers are just sane defaults in the probably-impossible
// case where somebody tries to read our state before the first
// 'progress' callback has fired.
var state = { percentComplete: 0, timeRemaining: 100, timeSpent: 0 };
if (!elt || elt.length === 0) {
return Promise.resolve();
}
if (!opts) {
opts = {};
} else {
opts = Ember.copy(opts);