MCPcopy Index your code
hub / github.com/apache/echarts / wrapMethod

Method wrapMethod

src/data/SeriesData.ts:1365–1379  ·  view source on GitHub ↗

* Wrap some method to add more feature

(
        methodName: FunctionPropertyNames<SeriesData>,
        injectFunction: (...args: any) => any
    )

Source from the content-addressed store, hash-verified

1363 * Wrap some method to add more feature
1364 */
1365 wrapMethod(
1366 methodName: FunctionPropertyNames<SeriesData>,
1367 injectFunction: (...args: any) => any
1368 ): void {
1369 const originalMethod = this[methodName];
1370 if (!zrUtil.isFunction(originalMethod)) {
1371 return;
1372 }
1373 this.__wrappedMethods = this.__wrappedMethods || [];
1374 this.__wrappedMethods.push(methodName);
1375 this[methodName] = function () {
1376 const res = (originalMethod as any).apply(this, arguments);
1377 return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));
1378 };
1379 }
1380
1381
1382 // ----------------------------------------------------------

Callers 8

beforeLinkMethod · 0.80
beforeLinkMethod · 0.80
beforeLinkMethod · 0.80
beforeLinkMethod · 0.80
beforeLinkMethod · 0.80
beforeLinkMethod · 0.80
wrapDataFunction · 0.80
linkSeriesDataFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected