Member-only story
Bad practices you should avoid using Angular

❌ Don’t do: Put the logic being handled in tap with empty subscribe
Don’t put the logic you will implement inside the tap operator, and keep the subscribe empty in case you will have many subscribers to your observable.
Why?: the tap operator is used mostly for side-effects like caching or logging and if you put your logic there, every subscriber will call the tap logic even no need for it
But!: It’s not a generic rule, it depends in your use case, if you want really all subscribers has this logic or you will have only one subscriber and you want to use the “async pipe” then my rule does not apply.
Code-Example:
Solution: use subscribe for logic, not tap
Don’t do ❌: Error functions in a subscription are just a console.error
Don't use console.error
For error handling, because logging only the error does not throw the error, and to know that something failed and your observable cannot continue execution
Solution: Use the provided Rxjs operators for error-handling to gracefully handle errors and retry logic
Don’t do ❌: some 3–4k line components
Don't put everything in only one component, because:
- Hard to do refactor
- Bad readability for other devs