Browse Source

HW 11 done

Olga_Brekhuntsova 2 years ago
parent
commit
34822f18cb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      hw-js-11-redux-cart/js/cart.js

+ 3 - 2
hw-js-11-redux-cart/js/cart.js

@@ -59,12 +59,13 @@ function createStore(reducer){
 
 const store = createStore(reducer);
 store.subscribe(() => console.log(store.getState()));
-
+store.subscribe(drawTable);
 for ( const item of Object.keys(store.getState())) { laryok.insertAdjacentHTML('beforeend', `<option >${item}</option>`)}
 
 buyButton.onclick = () => {
     store.dispatch({ type: "КУПИТЬ", ШО: laryok.value, СКОКА: amount.value, бабло:bablo.value });
-drawTable()}
+    
+}
 
 function drawTable() {
     goodsTable.innerHTML = "";