MCPcopy Create free account
hub / github.com/DavidWells/analytics / Debug

Function Debug

packages/analytics-core/src/utils/debug.js:5–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { LIB_NAME } from './internalConstants'
4
5export 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
23export function composeWithDebug(config) {
24 return function () {

Callers 2

analyticsFunction · 0.90
composeWithDebugFunction · 0.85

Calls 1

setFunction · 0.85

Tested by

no test coverage detected