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

Function hoc

src/trackingHoC.js:4–17  ·  view source on GitHub ↗
(trackingInfo, options)

Source from the content-addressed store, hash-verified

2import trackEventMethodDecorator from './trackEventMethodDecorator';
3
4export default function hoc(trackingInfo, options) {
5 return function decorator(...toDecorate) {
6 if (toDecorate.length === 1) {
7 // decorating a class
8 return withTrackingComponentDecorator(
9 trackingInfo,
10 options
11 )(...toDecorate);
12 }
13
14 // decorating a method
15 return trackEventMethodDecorator(trackingInfo)(...toDecorate);
16 };
17}

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected