I've seen some discussion about the Single Responsibility Principle (SRP) recently...
And it feels like some #Angular devs are struggling a bit with it. But it is really easy to follow in the front end. Here's a mental guide I use when to decide how to separate concerns:
First, look at the template
1. Is it too big?
2. Are there any pieces of it that can be separated and receive data via inputs?
3. Do those pieces have a meaningful name that is easy to come up with?
4. Extract to a dumb component
5. Are there any pieces of logic applied to many elements?
6. Extract to a directive
Then, look at your component TS code
1. Is it too big? Do parts of logic actually belong to child components?
2. Extract those parts
3. Does the component do anything related to the business logic (anything other than "take data and display it")?
4. Extract to a service
Finally, look at your services
1. Do certain services contain logic related to multiple entities (a service that does both orders and subscriptions, for example)?
2. Make separate services
3. Do you have a "utilities" service that contains lots of unrelated stuff?
4. Consider making more specialized services
With these steps, you can significantly improve like 80% of your app.
J: Postelja ni pospravljena, spet.
O: Joj saj ni nic po tleh.
J: Vse bi vas morali poslat sluzit vojsko.
O: Kaj je to “sluzit vojsko”?
J: Dedija vprasaj.
O: Dediju babi pospravi posteljo.
#enajstletnik
Apparently when you see your Iraqi neighbor shaking a carpet from the upstairs balcony it's not politically correct to yell "whats the matter, won't start?"
PhpStorm 2018.1 is out with lots of goodies for you to try! Inline functions and methods, refactor code between functional and imperative styles, create classes and methods from tests, test requests in HTTP client, and use Codeception code coverage! https://t.co/UtBcqQn1mn
Steps to Browsing a Website in 2018:
1. okay I'll accept cookies
2. yeah okay I'll disable my adblocker
3. sorry I don't want to sign up for your newsletter
...
15. *closes tab*
Dear publishers, there are good reasons why ad-blockers exist. Blocking ad-blocker users is a fight you can't win. Digital advertising has to evolve and take more relevant shapes than display ad units. Better to transition now than later.