Promise
Use Promise, প্রতিশ্রুতি, or Protishruti for asynchronous operations.
It provides static methods to resolve, reject, and combine promises, and instance methods to handle results.
Static Methods
Promise.resolve(v)→প্রতিশ্রুতি.সমাধান(v)→Protishruti.somadhan(v)Promise.reject(e)→প্রতিশ্রুতি.প্রত্যাখ্যান(e)→Protishruti.prottakhan(e)Promise.all(arr)→প্রতিশ্রুতি.সব(arr)→Protishruti.shob(arr)Promise.allSettled(arr)→প্রতিশ্রুতি.সব_সমাপ্ত(arr)→Protishruti.sobSomapto(arr)Promise.race(arr)→প্রতিশ্রুতি.দ্রুততম(arr)→Protishruti.drutotomo(arr)Promise.any(arr)→প্রতিশ্রুতি.যেকোনো(arr)→Protishruti.jekono(arr)Promise.withResolvers()→প্রতিশ্রুতি.সমাধানকারীদের_সহ()→Protishruti.somadhankariderSoho()
Instance Methods
p.then(fn)→p.তারপর(fn)→p.tarpor(fn)p.catch(fn)→p.ধরো(fn)→p.dhoro(fn)p.finally(fn)→p.অবশেষে(fn)→p.obosheshe(fn)
Examples
const p = প্রতিশ্রুতি.সমাধান(42);
p.তারপর(v => কনসোল.লগ(v));