* Reads the state tree managed by the store. * * @returns The current state tree of your application.
()
| 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, |
no outgoing calls
no test coverage detected