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

Is that possible to use async and await? If yes how? #64

Closed
vennsoh opened this issue Nov 24, 2020 · 1 comment
Closed

Is that possible to use async and await? If yes how? #64

vennsoh opened this issue Nov 24, 2020 · 1 comment

Comments

@vennsoh
Copy link

vennsoh commented Nov 24, 2020

So in my Sketch file, instead of

p5.keyPressed = () => {
...
...
bunch of chaining setTimeout (..., 1000)
}

Can I do,

async p5.keyPressed = () => {
...
...
await delay(1000)
}

What's the right syntax to do this?

@vennsoh
Copy link
Author

vennsoh commented Nov 24, 2020

Oh I think I got it, p5.keyPressed = async () =>

@vennsoh vennsoh closed this as completed Nov 24, 2020
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

1 participant