import aspect = require("dojo/aspect"); import { Cancellation } from "@implab/core-amd/Cancellation"; export const play = (ani: dojo._base.Animation, ct = Cancellation.none) => { if (ct.isSupported()) ct.register(() => ani.stop()); return new Promise(resolve => { aspect.after(ani, "onEnd", x => { resolve(); return x; }); ani.play(); }); };