Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mikaelvesavuori/5-minutes-or-less-solid

SOLID principles in TypeScript and JavaScript, demystified in less than 5 minutes each.
https://github.com/mikaelvesavuori/5-minutes-or-less-solid

demos design-patterns javascript js learning principles solid solid-principles ts typescript

Last synced: 2 months ago
JSON representation

SOLID principles in TypeScript and JavaScript, demystified in less than 5 minutes each.

Awesome Lists containing this project

README

        

# 5 Minutes or Less: SOLID principles in TypeScript/JavaScript

## SOLID principles in TypeScript and JavaScript, demystified in less than 5 minutes each

Everyone who's coded for some time has probably heard about these principles, but do you know them?

If you were ever afraid to ask, here's your chance to understand them easily and in just a few minutes each!

## Five Minutes or Less

- [Design Patterns](https://github.com/mikaelvesavuori/5-minutes-or-less-design-patterns)
- [TypeScript/JavaScript patterns and features](https://github.com/mikaelvesavuori/5-minutes-or-less-typescript-js)
- [Refactoring](https://github.com/mikaelvesavuori/5-minutes-or-less-refactoring)

## The SOLID Principles

The principles in their mnemonic order:

- [Single Responsibility Principle](src/single-responsibility-principle.ts)
- [Open-Closed Principle](src/open-closed-principle.ts)
- [Liskov Substitution Principle](src/liskov-substitution-principle.ts)
- [Interface Segregation Principle](src/interface-segregation-principle.ts)
- [Dependency Inversion Principle](src/dependency-inversion-principle.ts)

**My recommended way to approach them, from easiest to "hardest", is:**

- [Single Responsibility Principle](src/single-responsibility-principle.ts)
- [Liskov Substitution Principle](src/liskov-substitution-principle.ts)
- [Interface Segregation Principle](src/interface-segregation-principle.ts)
- [Open-Closed Principle](src/open-closed-principle.ts)
- [Dependency Inversion Principle](src/dependency-inversion-principle.ts)

## Running the code

You can install the things with `npm install` and then just go at each file with `npx ts-node src/{filename}.ts`.

Or, if you're lazy, you can also copy the individual TS file's contents into the [TypeScript playground](https://www.typescriptlang.org/play) if you want to avoid cloning and installing anything at all.