arch(wizards): support async bindPrompter functions (ContextOptions) #6094
Labels
architecture
feature-request
New feature or enhancement. May require GitHub community feedback.
refactor
wizard
Problem
Background: historically the
ContextOptions
functions were non-async because they are called in constructors. But now that we have async init() (example) as an "async" way to construct Wizards, the door is open to support async variants of these wizard ContextOptions.Expected behavior
Support async variants of the ContextOptions functions:
Promise
. example:if (result instanceof Promise)
(example) to decide how to handle the async variants:init()
is used to construct the Wizard. It is an error to define async ContextOptions on a wizard that callsbindPrompter
in its constructor (where async functions cannot be awaited).await
the functions infbindPrompter
Note
This is just a proposal. If it turns out that
bindPrompter
can safely acceptasync
ContextOptions functions that can be await'd just-in-time when the Wizard is run, then we can more easily support this without needing to care about "regular constructor vsinit()
".The text was updated successfully, but these errors were encountered: