--- id: 5a24c314108439a4d403614c title: Get State from the Redux Store localeTitle: Obtener el estado de la tienda redux challengeType: 6 isRequired: false --- ## Description
El objeto de almacenamiento Redux proporciona varios métodos que le permiten interactuar con él. Por ejemplo, puede recuperar el state actual mantenido en el objeto de almacenamiento de Redux con el método getState() .
## Instructions
El código del desafío anterior se reescribe más concisamente en el editor de código. Utilice store.getState() para recuperar el state de la store y asigne esto a una nueva variable currentState .
## Tests
```yml tests: - text: El almacén de redux debe tener un valor de 5 para el estado inicial. testString: 'assert(store.getState()===5, "The redux store should have a value of 5 for the initial state.");' - text: Debe existir una variable currentState y debe asignársele el estado actual del almacén de Redux. testString: 'getUserInput => assert(currentState === 5 && getUserInput("index").includes("store.getState()"), "A variable currentState should exist and should be assigned the current state of the Redux store.");' ```
## Challenge Seed
```jsx const store = Redux.createStore( (state = 5) => state ); // change code below this line ```
## Solution
```js const store = Redux.createStore( (state = 5) => state ); // change code below this line const currentState = store.getState(); ```