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

[Feature Request] Asynchronous DrawCommand #652

Open
nandin-borjigin opened this issue Jul 13, 2022 · 0 comments
Open

[Feature Request] Asynchronous DrawCommand #652

nandin-borjigin opened this issue Jul 13, 2022 · 0 comments

Comments

@nandin-borjigin
Copy link

regl is an awesome library to use! I really like it!

For my use case, I need to do some asynchronous staff in the command body function and wait for that asynchronous operation outside of the command.

regl(config)(async () => something());

// need to wait for something to finish

For now I'm utilizing p-defer, but I think if REGL.DrawCommand could forward the return value of its body, it would help a lot.

// for now
const deferred = defer();
regl(config)(async () => {
  await something();
  deferred.resolve();
})

await deferred.promise;
// desired

await regl(config)(() => something());
@nandin-borjigin nandin-borjigin changed the title [Feature Request] Asynchronous command [Feature Request] Asynchronous DrawCommand Jul 13, 2022
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