Open pentabarf opened 3 years ago
I also tried to use ngxsOnInit hook. but when using AsyncStoragePlugin ngxsOnInit never gets called. But it gets called when i disable AsyncStoragePlugin
Maybe too late, but I tried initializing ionic storage (2.x) in the angular APP_INITIALIZER (with blocking to wait until ionic storage was ready). My app.module.ts included:
NgxsModule.forRoot([], { developmentMode }), NgxsAsyncStoragePluginModule.forRoot(CustomStorageService),
And then I loaded all of my states in a child module (core.module.ts):
NgxsModule.forFeature([ AccountState, UserState...])
This has been working on Ionic 4 / Capacitor 2 for iOS, Android, and web.
Hello,
I am trying to use the async-storage-plugin together with cordova-sqlite-storage. The Storage Engine needs to get initialized (open DB etc.) Where is the right place to do this? AsyncStoragePlugin always wants to access before the DB is available. I was trying to init the DB with angular APP_INITIALIZER but this gets triggered after Ngxs init routines.