state , mas primeiro, aqui está uma análise de tudo que você aprendeu até agora. incAction e decAction criadores de ação, o counterReducer() , INCREMENT e DECREMENT tipos de ação, e, finalmente, a Redux store . Quando terminar, você poderá despachar as ações INCREMENT ou DECREMENT para incrementar ou decrementar o estado mantido na store . Boa sorte construindo seu primeiro app Redux! incAction deve retornar um objeto de ação com um type igual ao valor de INCREMENT
testString: 'assert(incAction().type ===INCREMENT, "The action creator incAction should return an action object with type equal to the value of INCREMENT");'
- text: O criador de ações decAction deve retornar um objeto de ação com um type igual ao valor de DECREMENT
testString: 'assert(decAction().type === DECREMENT, "The action creator decAction should return an action object with type equal to the value of DECREMENT");'
- text: O repositório do Redux deve inicializar com um state de 0.
testString: 'assert(store.getState() === 0, "The Redux store should initialize with a state of 0.");'
- text: Dispatching incAction no armazenamento do Redux deve incrementar o state em 1.
testString: 'assert((function() { const initialState = store.getState(); store.dispatch(incAction()); const incState = store.getState(); return initialState + 1 === incState })(), "Dispatching incAction on the Redux store should increment the state by 1.");'
- text: Dispatching decAction no armazenamento do Redux deve decrementar o state em 1.
testString: 'assert((function() { const initialState = store.getState(); store.dispatch(decAction()); const decState = store.getState(); return initialState - 1 === decState })(), "Dispatching decAction on the Redux store should decrement the state by 1.");'
- text: counterReducer deve ser uma função
testString: 'assert(typeof counterReducer === "function", "counterReducer should be a function");'
```