I have done it the same way…but the concept of is there a better way of doing it largely depends on little details, such as whether or not you worry about the user refreshing the back for any number of reasons this could happen and if the custom state values are lost or not.

I recently had to upgrade an app that is essentially a menu ordering app, with customizations to menu items as well as options like sauces or allergies. As the goal was to minimize WUs, I opted for an approach similar to yours in the sense that the order is not created until they submit the form. There may be some differences, as in the app I worked on it was a ‘form’ but had about 20+ different views as the user moved through the flow. Due to those concepts of saving WUs and not wanting custom states lost when user refreshes page or uses browser back button, I used URL parameters to store all the selected values.

This allows for a feature to show the user the ‘last order’ that they may have abandoned (for this I incorporate local storage).

Most of the time, custom states are fine if not concerned about lost values due to page refresh or browser back button usage, but if you are concerned about those things, than URL parameters is the way to go.

4 Likes