I recently attended a training session on Angular Signals and Effects, but I'm concerned about some of the recommended patterns, as they seem to contradict the declarative nature of Angular. I'd like to get the community's perspective on what constitutes a good practice for signals and effects. The Problematic "Good Practice" Example The training session recommended this pattern for fetching data from a service and setting it to a signal. user = signal<User | null>(null); constructor() { effect(() => { untracked(() => { this.userService.fetchUser().subscribe((user) => this.user.set(user)); }); }); } My concerns with this approach are: Multiple Sources of Truth: This is an imperative approach that mixes signal manipulation with a service subscription, making it harder to reason about the data flow. Potential Memory Leak: The subscribe call is not disposed of, which can lead to a memory leak. Incorrect Use of untracked: The purpose of untracked is to prevent a dependency from being created. Using it here means the effect will only ever run once, defeating the purpose of a reactive effect. My Proposed "Good Practice" My initial thought was to use toSignal to manage this declaratively, which feels much cleaner and follows the "single source of truth" principle. user = toSignal(this.userService.fetchUser(), { initialValue: null }); However, the trainer had a complaint about this: "What if you want to update the user later?" This is a valid point, as toSignal creates a read-only signal. So I proposed this next pattern, which separates the initial fetch from the signal that will be updated. fetchedUser = toSignal(this.userService.fetchUser()); user = signal<User | null>(null); populateUserEffect = effect(() => { const fetchedUser = this.fetchedUser(); this.user.set(fetchedUser) }) The Real Question Am I correct in my assessment that the training's first example is a bad practice? I know there will be a better option once the resource signal is production ready. But I feel the effect is not meant for this use case. Continue reading...