Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. /**
  2. How to use:
  3. 1. Inside React Dev Tools select <Provider>
  4. 2. Copy this script
  5. 3. Paste to console
  6. 4. Run
  7. */
  8.  
  9. let store = $r.store;
  10. let rawDispatch = store.dispatch;
  11. $r.store.dispatch = (action) => {
  12. console.group(action.type);
  13. console.log('%c prev state', 'color: gray', store.getState());
  14. console.log('%c action', 'color:blue', action);
  15. const returnValue = rawDispatch(action);
  16. console.log('%c next state', 'color: green', store.getState());
  17. console.groupEnd(action.type);
  18. return returnValue;
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement