Easier way to bind to all events "on" method

253
0
04-08-2023 11:02 PM
RamaniGanason
New Contributor III

Hi All,

Is there any simpler way to bind to all widget events? I know we can list down all available events of the widget as below but is there any simpler method to do this?

const slider = new Slider({
          container: "pixelSlider",
          min: -3,
          max: 37,
          steps: 1,
          values: [-3, 37],
          visibleElements: {
            labels: true,
            rangeLabels: true
          }
        });

// eg. This part I want to include all the available event for slider, for now I can list down all available event
slider.on(["max-change", "segment-click", ...], allEventFunction);

function allEventFunction(e) {
   console.log(e);
}

 

0 Kudos
0 Replies