Ionic Storage: wait until more than one value is loaded?

Hi to everyone!
I’m new to the Ionic world but i’m trying to use Ionic Storage to save some user informations when he is logged inside the app so when he will open it again, the app gets the data from the storage without calling again my web api.

This is what i usually do:

storage.set('myvalue', value);

and in my homepage i do:

storage.get('myvalue').then((value) => {
//use value

but if i want my app to wait until for example 10 elements are loaded?
Any suggestions?

Thank you!

Generally I think this is not a great idea, because if there are 10 bits of information that cannot function separately, I would combine them into a single object. That being said, you can investigate Promise.all().

Thanks for the answer, i can’t find an example of storing an object inside the Ionic Storage.
It’s possible right?

From an app perspective, storing objects looks exactly like storing scalars or anything else. You don’t have to do anything special.