-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Answer:2 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Answer:2 #8
Conversation
| ); | ||
|
|
||
| constructor(private actions$: Actions) {} | ||
| } |
There was a problem hiding this comment.
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 | ||
| " | ||
| > | ||
| "> |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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) ?? [] |
There was a problem hiding this comment.
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 []; |
There was a problem hiding this comment.
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
|
Thanks for submitting your answer. |
Checklist for challenge submission