Search⌘ K
AI Features

Accessing and Changing the Store

Understand how to access the current Redux state safely using getState and learn why state changes must go through dispatching actions. Explore how reducers handle actions to update the global state following Redux principles.

We'll cover the following...

Accessing the state

The getState() method returns the reference to the current state:

store.getState();
// => { recipes: [], ingredients: [] }

Changing the state

Redux does ...