While debugging, can I have access to the Redux store from the browser console?

前端 未结 9 1219
难免孤独
难免孤独 2020-12-12 14:01

I have unit tests for my reducers. However, when I\'m debugging in the browser, I want to check if my actions have been called correctly and whether the state h

9条回答
  •  温柔的废话
    2020-12-12 14:42

    If you're using Next JS, you can access the store by: window.__NEXT_REDUX_STORE__.getState()

    You can also dispatch actions, just look at the options you have in window.__NEXT_REDUX_STORE__

提交回复
热议问题