I have this service that's provided in root in an Angular 14 application:
@Injectable({
providedIn: 'root',
})
export class CoreThingService {
public readonly allThings$: Observable<Thing[]> =
this.fetchThings().pipe(take(1), shareReplay(1));
fetchThings(): Observable<Thing[]> {
// fetch things
}
}
Does allThings$ need to be unsubscribed somewhere in the CoreThingService to prevent memory leaks, even if it's provided in root instead of in a feature module?
If it does, how can I use something like Chrome DevTools to demonstrate the difference in memory use?