How to make a drop down menue fire a function on select

So under the documentation there is an example on how to add a drop down menu to PanelPlugin

import { ShapePanel } from './ShapePanel';

interface ShapePanelOptions {}

export const plugin = new PanelPlugin<ShapePanelOptions>(ShapePanel)
  .setPanelOptions(builder => {
    builder
      .addSelect({
        id: 'shape',
        name: 'Shape',
        description: 'Select shape to render'
        settings: {
          options: [
            {value: 'circle', label: 'Circle' },
            {value: 'square', label: 'Square },
            {value: 'triangle', label: 'Triangle }
           ]
        },
      })
  })

I would like to know how do I make it so that a certain function fires with the correct value when we select a label from a drop down menu.

1 Like