Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Make changes using MAP in http observable inside service or observer

I am taking a course from Pluralsight. The course mentions it is a good practice to make changes to the observables using map inside the service. I just want to know wouldn’t it be better to make changes outside the service to the observables since the same data maybe shared by other components as well?

I just want to know what is a good practice. Should I use MAP inside the service or the component?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, it’s a good practice, to make changes to the observables using "map" pipe, but if multiple components use your data source in different ways, make only generic changes in your service (suitable for all subscribers), and then you can make specific changes in another service serving a specific component.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading