This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have an observable subject of customers that is populated once the user logs in. This customers$ is then accessed by components on various routes across the application.
My issue: If the user refreshes the page I then don't have any records in customer$.
What is the best way to deal with this without having to retrieve the customers from the server each time the user navigates to a route that uses the customer data as this kind of kills the benefit of using observable subjects.
Is there a suitable place to check the array length on page reload but only if the isLoggedIn$ observable is set to true? (this is because the userID is required for the customer API request)
Thoughts / comments gratefully received
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Angular2/co...