If you use one sure.
It depends a lot on your code and what you use I’m afraid so there isn’t one single overall answer here.
You will need to save the states of all the components that are important and that you want to save the state of.