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

Function handler

packages/analytics-core/src/index.js:620–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618
619 const position = (name.match(startRegex)) ? before : after // eslint-disable-line
620 const handler = store => next => action => {
621 // Subscribe to EVERYTHING
622 if (action.type === name) {
623 callback({ // eslint-disable-line
624 payload: action,
625 instance: instance,
626 plugins: customPlugins,
627 abort: nonAbortable
628 })
629 }
630 /* For future matching of event subpaths `track:*` etc
631 } else if (name.match(/\*$/)) {
632 const match = (name === '*') ? '.' : name
633 const regex = new RegExp(`${match}`, 'g')
634 } */
635 return next(action)
636 }
637 addMiddleware(handler, position)
638 return () => removeMiddleware(handler, position)
639 },

Callers 2

batchFunction · 0.50
attachFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected