I keep digging how to make things efficient when saving data in Xano. I was used to the inmediate response from Firebase and I believe I have to change the way to do some things.
I have a post card where there is a like icon that has 2 states:
If there is no userID in the “likes” array of the document, it will be in state 0 (grey color).
If the userID is in the “likes” array, the icon will appear in green.
So far so good. I have configured the action and when the user clicks in the icon, it will either save the userID in the array and change the state, or remove the userID and change the state. This action goes just fine because I have specifically configured several actions and state will change without any waiting from the database. So it is inmediately that the icon turns green when the user clicks on it even though the response from the database may take a few more seconds.
My issue is because I have two other fields where this data is shown. There is a counter next to the icon showing the array.length. That number does not increase inmediately when the user clicks the icon. It goes up a couple of seconds later after the database response.
Same for a text that I have listing the name of the teachers that have pressed the icon. It is not automatically updated, and the change comes after a few seconds.
I have configured the action to also refresh the datasheets related with this data, but still it is not as inmediate as I would expect. I was wondering if it would be possible to manually increase that number and add the element to the list even though there is no response from the database yet, the same way I change the state of the icon.