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