Event Handler for legend selection

Is it possible to have an event handler called for when a legend item is selected? I don’t see anything in the reference that stands out as supporting this. I have seen posts from 2016 but was not sure if there have been any updates.

See https://plot.ly/javascript/plotlyjs-events/#legend-click-events