docs: function defineSwitchFunction(params){
      return function(){
        var args = arguments;
        
        // e.g. cy.nodes().select( data, handler )
        if( args.length === 2 ){
          var data = args[0];
          var handler = args[1];
          this.bind( params.event, data, handler );
        } 
        
        // e.g. cy.nodes().select( handler )
        else if( args.length === 1 ){
          var handler = args[0];
          this.bind( params.event, handler );
        }
        
        // e.g. cy.nodes().select()
        else if( args.length === 0 ){
          for( var i = 0; i < this.length; i++ ){
            var ele = this[i];
  
            if( !params.ableField || ele._private[params.ableField] ){
              ele._private[params.field] = params.value;
            }
          }
          this.updateStyle(); // change of state => possible change of style
          this.trigger(params.event);
        }
  
        return this;
      };
    }