jackdclark / five

Gives you five
https://five.js.org/
MIT License
1.53k stars 251 forks source link

five.promise #432

Open Cormanz opened 3 years ago

Cormanz commented 3 years ago

I'm a major consumer of APIs that are asynchronous (like discord.js) and wanted to make a Five discord bot. You should implement five.promise like so:

five.promise = () = new Promise(resolve => {
  setTimeout(() => resolve(5), 0);
});
bl9l commented 12 months ago

Yeah! We need to follow modern trends. Btw here even more modern realization.

five.promise = () = new Promise(resolve => {
  requestAnimationFrame(() => resolve(5));
});