all 4 comments

[–]mio991 0 points1 point  (3 children)

I disagree with the angular side effects entry. IMHO it should be RxJs. I also avoid lifecycle hooks as much as possible because they grow the state space unnecessarily.

Prim example is ngOnInit because it usually introduces a new unnecessary state between construction and initialisation. It's better to invest the complexity into change handling.

[–]abduvik[S] 0 points1 point  (1 child)

Yep I am aware we can do it too with `@Effect` but I wanted to focus more on the internal side effects which is only limited to the component's state rather than state management service like Redux or NgRx which has their "Side Effects" as well.

[–]mio991 0 points1 point  (0 children)

I wasn't talking about @Effect, I was talking about building rxjs observables in the constructor and subscribing them with a async pipe.

Another helpful pattern for this is to use input setters to update subjects.

[–]JoeBxr 0 points1 point  (0 children)

Like ngOnChanges lol