I'm currently in the process of learning NgRx, but I'm struggling to comprehend why entity selectors would trigger actions. Despite my efforts to find an explanation, I have come up short. It's possible that I may be missing some fundamental concepts of NgRx/Entity.
Here is a snippet of my demonstration code:
selectors.ts
export const selectHeroState: MemoizedSelector<object, HeroesState> = createFeatureSelector<HeroesState>('heroes');
export const selectHeroes: (state: object) => Hero[] = heroAdapter.getSelectors(selectHeroState).selectAll;
component.ts
ngOnInit() {
//this.store$.dispatch(new GetAll()); Initially, I believed this line of code was necessary to retrieve all data from the store...
this.heroes$ = this.store$.select(selectHeroes); //but it turns out that only this line triggers the Get All action
}
I hope I have articulated my question clearly. Thank you in advance for your assistance.