Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

five.promise #432

Open
Cormanz opened this issue May 20, 2021 · 1 comment
Open

five.promise #432

Cormanz opened this issue May 20, 2021 · 1 comment

Comments

@Cormanz
Copy link

Cormanz commented May 20, 2021

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
Copy link

bl9l commented Nov 17, 2023

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants