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
exportdefaultdefineCommand({meta: {name: 'test',description: 'Test command',},asyncsetup(context){constdata=someComputed(context)return{ data }},asyncrun({ args },{ data }){console.log(data)}})
Reason
The return value of setup could be useful, in addition to some initialization behavior, it could potentially produce different values depending on the context, which could be used in setup and passed to all subcommands in the run method arguments!
Of course, I may not have thought this through completely, does anyone else have a better suggestion?
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Currently it can only be passed implicitly by putting the variable into global scope, or mounting it on a context object. I don't think this is a good and safe way to 👀
Describe the feature
Reason
The return value of
setup
could be useful, in addition to some initialization behavior, it could potentially produce different values depending on thecontext
, which could be used insetup
and passed to all subcommands in the run method arguments!Of course, I may not have thought this through completely, does anyone else have a better suggestion?
Additional information
The text was updated successfully, but these errors were encountered: