|
@@ -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 = "";
|