Skip to content

Commit 6deca2c

Browse files
authored
Tweak getOriginalState doc wording
1 parent f0e5623 commit 6deca2c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/action-listener-middleware/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ The `listenerApi` object is the second argument to each listener callback. It co
210210

211211
- `dispatch: Dispatch`: the standard `store.dispatch` method
212212
- `getState: () => State`: the standard `store.getState` method
213-
- `getOriginalState: () => State`: returns the store state as it existed when the action was originally dispatched, _before_ the reducers ran.
214-
This method can only be called synchronously, it throws error otherwise.
213+
- `getOriginalState: () => State`: returns the store state as it existed when the action was originally dispatched, _before_ the reducers ran. (**Note**: this method can only be called synchronously, during the initial dispatch call stack, to avoid memory leaks. Calling it asynchronously will throw an error.)
215214

216215
`dispatch` and `getState` are exactly the same as in a thunk. `getOriginalState` can be used to compare the original state before the listener was started.
217216

0 commit comments

Comments
 (0)