How to dispatch an Event?

How I could dispatch a custom event from ‘#input1’ in this function?

What i tried:

export function captcha1_verified() {
    $w('#input1').show();

    const myEvent = new CustomEvent("myevent", {
        detail: {},
        bubbles: true,
        cancelable: true,
        composed: false,
    });

    $w('#input1').dispatchEvent(myEvent);
}

You can’t dispatch custom events in Velo itself but if you’re trying to do this for event based state management you could use something like https://mobx.js.org or https://github.com/shoonia/storeon-velo