Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Last active July 29, 2018 15:29
Show Gist options
  • Save raulmoyareyes/315a00166002fb499e3be2c538cdde10 to your computer and use it in GitHub Desktop.
Save raulmoyareyes/315a00166002fb499e3be2c538cdde10 to your computer and use it in GitHub Desktop.
[ Wrong ] - Single Responsability Principle
class UserSettings {
constructor(user) {
this.user = user;
}
changeSettings(settings) {
if (this.verifyCredentials()) {
// ...
}
}
verifyCredentials() {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment