Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer:2 effect vs selector #912

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LMFinney
Copy link
Sponsor Contributor

The description said to use only one action from the component, but I used the effect lifecycle instead, so the component dispatches nothing.
Also, I used createFeature to simplify the selectors.

Checklist for challenge submission

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

Warning:

  • If you want feedback or review, you must support the project on GitHub:

Alternatively, you can still submit your PR to join the list of answered challenges or to be reviewed by a community member. 馃敟

Use new control flow
Use selectSignal instead of select
Consolidate border styles to a single line
Remove boilerplate selectors
Move compound selector into extraSelectors
Move the effect and reducer into a new selector
refactor to have the component select once, not additionally for each activity
@github-actions github-actions bot added 2 exercice ngrx-1 answer answer sponsor sponsor the project to be reviewed PR requests a review labels May 14, 2024
}
}, []);
}
return [];
Copy link
Owner

Choose a reason for hiding this comment

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

馃憤

@tomalaforge tomalaforge removed the to be reviewed PR requests a review label May 20, 2024
@tomalaforge
Copy link
Owner

Good job. The goal of this challenge is to show that selectors are very powerful and the used to derive the state. Like computed in signals. We shouldn't store derived piece of state.

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 sponsor sponsor the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants