1.6 KiB
1.6 KiB
id | title | challengeType | isRequired | videoUrl | localeTitle |
---|---|---|---|---|---|
5a24c314108439a4d403614c | Get State from the Redux Store | 6 | false | Obtener el estado de la tienda redux |
Description
state
actual mantenido en el objeto de almacenamiento de Redux con el método getState()
. Instructions
store.getState()
para recuperar el state
de la store
y asigne esto a una nueva variable currentState
. Tests
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 <code>currentState</code> y se le debe asignar el estado actual del almacén de Redux.
testString: 'getUserInput => assert(currentState === 5 && getUserInput("index").includes("store.getState()"), "A variable <code>currentState</code> should exist and should be assigned the current state of the Redux store.");'
Challenge Seed
const store = Redux.createStore(
(state = 5) => state
);
// change code below this line
Solution
// solution required