MCPcopy
hub / github.com/reduxjs/redux / getState

Function getState

src/createStore.ts:167–177  ·  src/createStore.ts::getState

* Reads the state tree managed by the store. * * @returns The current state tree of your application.

()

Source from the content-addressed store, hash-verified

165 * @returns The current state tree of your application.
166 */
167 function getState(): S {
168 if (isDispatching) {
169 throw new Error(
170 class="st">'You may not call store.getState() while the reducer is executing. ' +
171 class="st">'The reducer has already received the state as an argument. ' +
172 class="st">'Pass it down from the top reducer instead of reading it from the store.'
173 )
174 }
175
176 return currentState as S
177 }
178
179 /**
180 * Adds a change listener. It will be called any time an action is dispatched,

Callers 14

addTodoIfEmptyFunction · 0.85
loggerMiddlewareFunction · 0.85
applyFunction · 0.85
observeStateFunction · 0.85
incrementIfOddFunction · 0.85
incrementIfOddFunction · 0.85
fetchPostsIfNeededFunction · 0.85
loadUserFunction · 0.85
loadRepoFunction · 0.85
loadStarredFunction · 0.85
loadStargazersFunction · 0.85
addToCartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected