Redux Store
The entire state of the application is stored in an object called Redux Store. We can create a Redux Store using the configureStore function imported from @reduxjs/toolkit:
import { configureStore } from '@reduxjs/toolkit';
const store = configureStore({ reducer: counterReducer });
In the configureStore function we pass an object containing at least one reducer. The store is a reference to the create store. We can access the object containing the state data using the getState method:
console.log(store.getState())
// {countValue: 7}
Tak for dine kommentarer!
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Spørg mig spørgsmål om dette emne
Opsummér dette kapitel
Vis virkelige eksempler
Awesome!
Completion rate improved to 3.45
Redux Store
Stryg for at vise menuen
The entire state of the application is stored in an object called Redux Store. We can create a Redux Store using the configureStore function imported from @reduxjs/toolkit:
import { configureStore } from '@reduxjs/toolkit';
const store = configureStore({ reducer: counterReducer });
In the configureStore function we pass an object containing at least one reducer. The store is a reference to the create store. We can access the object containing the state data using the getState method:
console.log(store.getState())
// {countValue: 7}
Tak for dine kommentarer!