Skip to content

Conversation

@chrissena
Copy link

Checklist for challenge submission

  • Start your PR message with Answer:${challenge_number}

);

constructor(private actions$: Actions) {}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this effect is not necessary. UserEffect and ActivityEffect can both listen to appAction.initApp.

| async
"
>
">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the goal is to avoid calling a function inside a template. The view object should be constructed inside the selector. Thus in the view, only property of that object will be rendered

this.store.dispatch(loadActivities());
this.store.dispatch(loadUsers());
this.store.dispatch(loadStatuses());
this.store.dispatch(initApp());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, that cleaner

selectStatusState,
(state) => state.teachersMap.get(name) ?? []
selectTeachersMap,
(teachersMap) => teachersMap.get(name) ?? []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the last two selectors. You should create a viewModel with construct your final object that you will use in your view

}
}, []);
}
return [];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that 's the way to do it, nice

@tomalaforge tomalaforge added answer answer 2 exercice ngrx-1 labels Nov 25, 2022
@tomalaforge
Copy link
Owner

Thanks for submitting your answer.

@tomalaforge tomalaforge added the comments there are unresolved comments label Jan 2, 2023
@tomalaforge tomalaforge closed this Oct 1, 2023
AlexxxTr added a commit to AlexxxTr/angular-challenges that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 exercice ngrx-1 answer answer comments there are unresolved comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants