Would the following code be a terrible anti pattern, and is there a better way to observe event responses. I specifically need to see the event response asynchronously
component.dispatchEvent(new CustomEvent('some-event', { detail: (arg) => {
// do something with arg
}}))
window.addEventListener('some-event', async (event) => {
// do something asynchronously and generate result data
event.detail(result)
})