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

Allow waitUntil to accept a callback that returns a promise #1393

Open
boris-petrov opened this issue May 25, 2023 · 1 comment
Open

Allow waitUntil to accept a callback that returns a promise #1393

boris-petrov opened this issue May 25, 2023 · 1 comment

Comments

@boris-petrov
Copy link

boris-petrov commented May 25, 2023

Right now, waitUntil expects that the callback returns a truthy/falsy value. It would be nice to allow the callback to return a promise which resolves to a truthy/falsy value. So something like to work (and return after 1 second not immediately like now because the returned promise is a truthy value):

await waitUntil(() => new Promise((resolve) => setTimeout(() => resolve(true), 1000)));
@rishiraj88
Copy link

Thanks for this, @boris-petrov .

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