export default class View {
    constructor(name, parent, element, position='beforeend') {
        this.name = name;
        this.parent = parent;
        this.element = element;
        this.position = position;

        this.parent.addEventListener(`contentrefresh-${this.name}`, this.render.bind(this));
    }

    render(html) {
        this.element.insertAdjacentHTML(this.position, html.detail.html);
    }
}
