* 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)
| 481 | * @returns {any} |
| 482 | */ |
| 483 | function 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 | |
| 493 | export class Tooltip extends Element { |
| 494 |
no outgoing calls
no test coverage detected