I have a Storage service using the Ionic Storage class, and a HttpService with methods that retrieve certain keys from Storage if present, else request the data from an endpoint.
I was attempting to call these methods in the root App Component, but the storage case was never realised - it was always downloading the data from the server.
I discovered this was due to a race condition - I’m calling Storage.create() on initialisation of the storage service, but this asynchronous operation is still taking place when the App component initialises.
Able to avoid the race condition by moving the method calls to the Home.page component.
Curious if this is intended behaviour and calling these methods in Home.page is safe/robust, or whether it’d be better to wrap my Storage services public methods in such a way that they await completion of the .create() call.