You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing that puzzles me a bit is how to handle firebase data that uses the uid in the path with ngrx. This has to be a common thing, but is not yet covered in the example provided.
One thought I had was to use an effect that was only active while there was an authenticated user. It seems that OnRunEffects was made for this, but I couldn't quite get the effect pieced together in an understandable way. Right now I simply use a service that has code like this in it:
You can store the user or even just the uid in the store on login (authState change) then you have a store value available. If you need the uid in the path you first get a selector and then start the observable chain from it to ensure you get the uid for the rest of the observable piping for what you need to do. This is what I came up with:
One thing that puzzles me a bit is how to handle firebase data that uses the
uid
in the path with ngrx. This has to be a common thing, but is not yet covered in the example provided.One thought I had was to use an effect that was only active while there was an authenticated user. It seems that OnRunEffects was made for this, but I couldn't quite get the effect pieced together in an understandable way. Right now I simply use a service that has code like this in it:
With this approach I can automatically update the emit'd values whenever the user authenticates or not, so how would you handle this with ngrx?
The text was updated successfully, but these errors were encountered: