on(methodName, newMethod) {
        if (!methodName || !newMethod) {
            return;
        }
        methodName = methodName.toLowerCase();
        if (!this._methods[methodName]) {
            this._methods[methodName] = [];
        }
        // Preventing adding the same handler multiple times.
        if (this._methods[methodName].indexOf(newMethod) !== -1) {
            return;
        }
        this._methods[methodName].push(newMethod);
    }
/** Registers a handler that will be invoked when the hub method with the specified method name is invoked.
     *
     * @param {string} methodName The name of the hub method to define.
     * @param {Function} newMethod The handler that will be raised when the hub method is invoked.
     */
Registers a handler that will be invoked when the hub method with the specified method name is invoked.
@param {string} methodName The name of the hub method to define.
@param {Function} newMethod The handler that will be raised when the hub method is invoked.
Registers a handler that will be invoked when the hub method with the specified method name is invoked . @param { string } methodName The name of the hub method to define . @param { Function } newMethod The handler that will be raised when the hub method is invoked .
on(methodName, newMethod) {
        if (!methodName || !newMethod) {
            return;
        }
        methodName = methodName.toLowerCase();
        if (!this._methods[methodName]) {
            this._methods[methodName] = [];
        }
        if (this._methods[methodName].indexOf(newMethod) !== -1) {
            return;
        }
        this._methods[methodName].push(newMethod);
    }
on ( methodName , newMethod ) { if ( ! methodName || ! newMethod ) { return ; } methodName = methodName . toLowerCase ( ) ; if ( ! this . _methods [ methodName ] ) { this . _methods [ methodName ] = [ ] ; } if ( this . _methods [ methodName ] . indexOf ( newMethod ) !== - 1 ) { return ; } this . _methods [ methodName ] . push ( newMethod ) ; }
Registers a handler that will be invoked when the hub method with the specified method name is invoked.
Registers a handler that will be invoked when the hub method with the specified method name is invoked .
// Preventing adding the same handler multiple times.