My application is getting quite heavy and I ask myself many questions. And here is the first.
I have graphic elements in which I put sometimes complex data extraction formulas (from a json for example) to display the desired data.
Do you think it is more efficient to leave things like this or to use a variable to which we attribute this calculation value on an event and then we display the variable in the graphic element?
I open the debate!
I would suggest processing as much logic as possible on the page-focused / page-mounted event or some events that show/hide components on your page.
Because this would allow you to show a spinner, loading animation, which is more user-friendly than simply making them wait for the data to show up and also helps when it comes to user interaction.
If they do not see the data they may be tempted to try to refresh the page and restart the app which would cause the flows to start from the beginning. So yeah, a clear indication of loading is advised.
Also for non-overcomplicated lists of objects, it is okay to use them as view components data but can be advised to use data variables or page variables as placeholders and do modifications to the variables instead of the view component’s value property.
This especially applies to scroll view components as they load all of their inside containers at the initial loading, which might take a while.