I'm applying this library which is called noty and I want to resolve this promise. Here is the code.
var bouncejsClose = function (promise) {
var n = this;
new Bounce()
.translate({
from: { x: 0, y: 0 }, to: { x: 450, y: 0 },
easing: 'bounce',
duration: 500,
bounces: 4,
stiffness: 1
})
.applyTo(n.barDom, {
onComplete: function () {
promise(function (resolve) {
resolve();
});
}
});
};
You can't resolve a
Promisefromoutsideof its declaration, what you need to do is: