Olga_Brekhuntsova 2 år sedan
förälder
incheckning
34822f18cb
1 ändrade filer med 3 tillägg och 2 borttagningar
  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 = "";