Skip to content

Commit

Permalink
test7 fix merge pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ershegm committed Apr 14, 2024
1 parent f7c0bdc commit c3b08e7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/view/item-list-view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import AbstractView from '../framework/view/abstract-view.js';

export default class ItemListView extends AbstractView {
_items = [];
_handleItemChange = null;

constructor ({
items,
onItemChange
}) {
super();
this._items = items;
this._handleItemChange = onItemChange;
this.element.addEventListener('change', this.#itemChangeHandler);
}

#itemChangeHandler = (evt) => {
evt.preventDefault();
this._handleItemChange?.(evt.target.dataset.item);
};
}

0 comments on commit c3b08e7

Please sign in to comment.