I’ve verified that calling close does resolve the Promise.
However, when isOpen isn’t managed inside the OverlayControllerComponent, a typical pattern would be to control the overlay by calling only unmount, without invoking close. In that scenario, I’m concerned that openAsync might never resolve, which could lead to unexpected behavior. Is it intentional that the Promise can be resolved only by calling close? If so, is the recommended best practice to always call close before invoking unmount?
If the current behavior isn’t intentional, I’d like to suggest two possible approaches:
Option 1.
Resolve the openAsync Promise when unmount is called.
Option 2.
Have the component mounted by openAsync resolve the Promise in a cleanup routine when it is unmounted.
I’ve verified that calling
closedoes resolve the Promise.However, when
isOpenisn’t managed inside the OverlayControllerComponent, a typical pattern would be to control the overlay by calling onlyunmount, without invokingclose. In that scenario, I’m concerned thatopenAsyncmight never resolve, which could lead to unexpected behavior. Is it intentional that the Promise can be resolved only by callingclose? If so, is the recommended best practice to always callclosebefore invokingunmount?If the current behavior isn’t intentional, I’d like to suggest two possible approaches:
Option 1.
Resolve the
openAsyncPromise whenunmountis called.Option 2.
Have the component mounted by
openAsyncresolve the Promise in a cleanup routine when it is unmounted.