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

前端 未结 9 1244
难免孤独
难免孤独 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:38

    First of all, you need to define the store in the window object (You can place it in you configureStore file):

    window.store = store;
    

    Then you only need to write in the console the following:

    window.store.getState();
    

    Hop this helps.

提交回复
热议问题