SyntaxError: Неверный инициализатор сокращенного свойства (после указания индекса узла команды в терминале) - PullRequest
0 голосов
/ 07 мая 2020

`const redux = require ('redux') const createStore = redux.createStore

const BUY_CAKE = 'BUY_CAKE'

function buycake () {

   return

{type: BUY_CAKE, info: 'First Redux Action'}} const initialState = {numOfCakes = 10}

const reducer = (state = initialState, action) => {switch (action.type) {case BUY_CAKE: return {... state, numOfCakes = state.numOfCakes -1}

    default: return state
}

}

const store = createStore (reducer) console.log ('Initial State', store .getstate ()) const unsubscribe = store.subscribe (() => console.log ('Обновлено состояние', store.getstate ())) store.dispatch (buycake ()) store.dispatch (buycake ()) store. отправка (buycake ()) unsubscribe () `

...