five
five copied to clipboard
five.promise
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);
});
Yeah! We need to follow modern trends. Btw here even more modern realization.
five.promise = () = new Promise(resolve => {
requestAnimationFrame(() => resolve(5));
});