I want to handle the loadfailure sceanrio from my component so that I can handle the no data in view html. Should I add selectors for error sceanrio or handle it in effects. I am pretty novice to ngrx style of fetching data based on actions
Asked
Active
Viewed 2,471 times
1 Answers
0
Added the error state to the NgRx store is the most straightforward approach. With selectors you can read the error state and re-render the component.
Brandon Roberts wrote a detailed article with some alternatives, for more info see https://brandonroberts.dev/blog/posts/2019-03-04-handling-error-states-with-ngrx/

timdeschryver
- 14,415
- 1
- 19
- 32
-
I added error selector and added error condition in reducer, and subscribed the store with error selector from component – not-a-bug Dec 16 '21 at 10:09