Accessing a reducer state from within another reducer

You can call getState() over a store to get the list of reducers and the current state inside the reducers.

  1. Import the store into auditLoading (use store to get values. Don’t mutate the store)
  2. store.getState().auditLoading will give you the state of auditLoading reducer.

This approach is similar to the callback provided by redux-thunk. In which (dispatch, getState) => {} will be returned to the action.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)