I'm using NGXS for my state management, it's quite concise and practical. I've multiple store, almost one per module in my angular app.
The issue I've is that when I do select, I've to specify myself what is the type of the selected property. I had already some occurences where the store changed but not all the usage, and it was not possible to detect the issue before going on the page and having an error. Also it would help to be able to just ctrl+click on the property I'm selecting to check the model definition.
Here are some examples on how I select data:
//here instead of boolean, I could have put anything, it won't crash until I actually execute the code
this.loading = this.store.select<boolean>(state => state.organization.isLoading);
//same with snapshot selection:
this.store.selectSnapshot<Organization>(state => state.organization.selectedOrganization);
Is there a way to select stuff and have type safety? for both snapshot and normal selection?