You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be good to have a submodule that uses top-level await to halt code execution until the user or user agent accepts the Web MIDI API permission. I think it would be a bad idea to do this on the main module since it could be blocked for minutes.
Possible example of a wrapper that could use top level await to simplify implementation
@rocketry/plugin-web-midi/sync
importpluginWebMidi,{init}from"./index";awaitinit();// will use default optionsexportdefaultpluginWebMidi;export*from"./index";
comsumer.js
import"@rocketry/plugin-web-midi/sync";importrocketryfrom"@rocketry/core";// Use Rocketry here without having to worry about making an async context// Nothing past the last import will run until the permissions have been accepted/rejected
The text was updated successfully, but these errors were encountered:
I think it would be good to have a submodule that uses top-level
await
to halt code execution until the user or user agent accepts the Web MIDI API permission. I think it would be a bad idea to do this on the main module since it could be blocked for minutes.Currently, the proposal for top-level await is at stage 2 and I don't know when/if support will come to Node.js.
Possible example of a wrapper that could use top level await to simplify implementation
@rocketry/plugin-web-midi/sync
comsumer.js
The text was updated successfully, but these errors were encountered: