MCPcopy
hub / github.com/nytimes/react-tracking / trackEvent

Function trackEvent

src/trackEventMethodDecorator.js:7–21  ·  view source on GitHub ↗
(...promiseArguments)

Source from the content-addressed store, hash-verified

5 decoratedFn =>
6 function decorateClassMember(...args) {
7 const trackEvent = (...promiseArguments) => {
8 if (
9 this.props &&
10 this.props.tracking &&
11 typeof this.props.tracking.trackEvent === 'function'
12 ) {
13 const thisTrackingData =
14 typeof trackingData === 'function'
15 ? trackingData(this.props, this.state, args, promiseArguments)
16 : trackingData;
17 if (thisTrackingData) {
18 this.props.tracking.trackEvent(thisTrackingData);
19 }
20 }
21 };
22
23 const fn = Reflect.apply(decoratedFn, this, args);
24 if (Promise && Promise.resolve(fn) === fn) {

Callers 8

useTrackingImplFunction · 0.85
ChildFunction · 0.85
blahFunction · 0.85
handleClickFunction · 0.85
exampleMethodFunction · 0.85
handleAsyncActionFunction · 0.85
executeActionFunction · 0.85

Calls

no outgoing calls

Tested by 6

ChildFunction · 0.68
blahFunction · 0.68
handleClickFunction · 0.68
exampleMethodFunction · 0.68
handleAsyncActionFunction · 0.68
executeActionFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…