five icon indicating copy to clipboard operation
five copied to clipboard

five.promise

Open Cormanz opened this issue 4 years ago • 1 comments

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);
});

Cormanz avatar May 20 '21 18:05 Cormanz

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

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

bl9l avatar Nov 17 '23 15:11 bl9l