Skip to content

[Feature Request] Asynchronous DrawCommand #652

@nandin-borjigin

Description

@nandin-borjigin

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions