import {Controller} from '@hotwired/stimulus';
import {getComponent} from '@symfony/ux-live-component';

export default class extends Controller {

    component = null;

    async connect() {
        this.component = await getComponent(this.element);
    }

    async reset() {
        if (!this.component) {
            this.component = await getComponent(this.element)
        }
        await this.component.action('reset');
    }
}
