()
| 3 | import { LIB_NAME } from './internalConstants' |
| 4 | |
| 5 | export function Debug() { |
| 6 | // Global key is window.__global__.analytics |
| 7 | set(LIB_NAME, []) |
| 8 | // Return debugger |
| 9 | return (createStore) => { |
| 10 | return (reducer, preloadedState, enhancer) => { |
| 11 | const store = createStore(reducer, preloadedState, enhancer) |
| 12 | const origDispatch = store.dispatch |
| 13 | const dispatch = (action) => { |
| 14 | const a = action.action || action |
| 15 | globalContext[KEY][LIB_NAME].push(a) |
| 16 | return origDispatch(action) |
| 17 | } |
| 18 | return Object.assign(store, { dispatch: dispatch }) |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | export function composeWithDebug(config) { |
| 24 | return function () { |
no test coverage detected