Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Cómo resolver esta promesa

Estoy aplicando esta biblioteca que se llama noty y quiero resolver esta promesa. Aquí está el código.

 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(); }); } }); };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No puede resolver una Promise desde outside de su declaración, lo que debe hacer es:

 var bouncejsClosePromise = new Promise((resolve, reject) => { 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 () { //now you can resolve here resolve(/** with any value you want to get when calling .then method */) } }); }); bouncejsClosePromise.then((/** if you pass value to the resolve callback, you can get it here */) => { //your promise successfully resolved }).catch(() => { //or in case you used reject in your promise, you can handle it here })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!