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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Angular - NgRx - SCSS] Create mapping functions for parsing data between API response and store #825

Open
lindakatcodes opened this issue Nov 3, 2022 · 0 comments
Assignees

Comments

@lindakatcodes
Copy link
Contributor

lindakatcodes commented Nov 3, 2022

Currently, each effect file in the store is mapping the data from the service calls into the shape we want for the state. We'd like to refactor these mappings out into their own file, and let the effects use the mapping to help the effects look cleaner.

You can see an example of this in the state/user file - a user.mapping.ts file has been created with the mapping functions, and then the user.effects.ts file is using those mappings. This ticket will cover the work to do the same thing in the other state files - create a .mapping.ts file to hold the functions, and update the related effect to use those functions.

If an effect's mapping is 3 lines or less, that can likely stay in the effect. If it's larger or more deeply nested than that, please create a mapping function for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants