Is it possible to store a "state" of the application easily?


#1

Hi,

The last step to build my very first app is to manage to store data, I read documentation but I wonder if it’s possible to just store a “state” of the application.
When I use the application, every action is “stored” until I close the application. Is it possible to save the state in a global variable (I just don’t know what I’m talking about) rather than store each variable I manipulate ?

Thanks for the answer !


#2

You have to define precisely what constitutes “state” and how to restore it. Once you’ve done that, you can create a JSON object that includes all of it and persist it via ionic-storage.