How do I get the values of the latest item in a repeater?

I'm using listeners on my repeater to create and delete items. I'm doing this because there is a round trip to an API to complete the actual INSERT, before it is then persisted locally.

The only method I can find to extract the values is
$component->getState()
that I use inside my event listener closure.

But this seems to return the state of the whole repeater - I can see the data I need in the final node of the array, which I could array_pop off. But is there a better way to get this?
image.png
Was this page helpful?