raw from 'ember-macro-helpers/raw'; import { task, timeout } from 'ember-concurrency'; export default ASky.extend({ animation: stringifyComponent('animation', { property: raw('material.color'), startEvents: raw('set-image-fade'), dir: raw('alternate'), dur: 'dur', from: raw('#FFF'), to: raw('#000') }), changeMaterialTask: task(function * (src) { yield timeout(this.get('dur')); this.sendAction('changeMaterial', src); }), actions: { startChangingMaterial(src) { this.element.emit('run-animation'); this.get('changeMaterialTask').perform(src); } } });