MCPcopy Create free account
hub / github.com/chartjs/Chart.js / invokeCallbackWithFallback

Function invokeCallbackWithFallback

src/plugins/plugin.tooltip.js:483–491  ·  view source on GitHub ↗

* Invoke callback from object with context and arguments. * If callback returns `undefined`, then will be invoked default callback. * @param {Record } callbacks * @param {keyof typeof defaultCallbacks} name * @param {*} ctx * @param {*} arg * @returns {a

(callbacks, name, ctx, arg)

Source from the content-addressed store, hash-verified

481 * @returns {any}
482 */
483function invokeCallbackWithFallback(callbacks, name, ctx, arg) {
484 const result = callbacks[name].call(ctx, arg);
485
486 if (typeof result === 'undefined') {
487 return defaultCallbacks[name].call(ctx, arg);
488 }
489
490 return result;
491}
492
493export class Tooltip extends Element {
494

Callers 6

getTitleMethod · 0.85
getBeforeBodyMethod · 0.85
getBodyMethod · 0.85
getAfterBodyMethod · 0.85
getFooterMethod · 0.85
_createItemsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected