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()
$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?
1 Reply
Patrick Boivin
Patrick Boivin16mo ago
I think array_pop() is fine... or simply end($component->getState())
Want results from more Discord servers?
Add your server