https://github.com/ntonbala/patterns-js
Common programming patterns in JS implementation
https://github.com/ntonbala/patterns-js
js patterns
Last synced: 10 months ago
JSON representation
Common programming patterns in JS implementation
- Host: GitHub
- URL: https://github.com/ntonbala/patterns-js
- Owner: NtonBala
- Created: 2024-03-12T12:10:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T11:21:38.000Z (over 1 year ago)
- Last Synced: 2025-01-26T07:42:38.590Z (11 months ago)
- Topics: js, patterns
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Patterns
Common programming patterns in JS implementation.
Project is run in node terminal: to execute a specific pattern run `node ${patternDirectoryName}`.
**Patterns covered:**
1. [Module](./module/index.md 'Allows to create private variables and functions. Also allows to strictly indicate its own dependencies.')
1. [Factory](./factory/index.md 'Allows to create objects, hiding implementation details from the user. E.g. when object creation logic is of high complexity (objects are created from several sources) or you need to create many objects with the same fields.')
1. [Facade](./facade/index.md 'Is about creating a simple interface to a large, complex piece of code in order to hide its complexity.')
1. [Decorator](./decorator/index.md 'Allows to dynamically add new behavior to objects, avoiding creating a number of subclasses and changing default behavior.')
1. [Observer](./observer/index.md 'Observer pattern allows different parts of application respond to various events by creating _one-to-many_ relations between components.')
**Patterns to cover:**
1. [PubSub](https://monsterlessons.com/project/lessons/publishsubscribe-v-javascript) (publish/subscribe)
1. [Singleton](https://monsterlessons.com/project/lessons/singleton-pattiern-v-javascript)
1. [Constructor](https://monsterlessons.com/project/lessons/constructor-pattern-v-javascript)
1. [Strategy](https://monsterlessons.com/project/lessons/strategy-pattern-v-javascript)
## Functional JS
**Techniques covered:**
1. [Mixins](./mixins/index.md)
**Techniques to cover:**
1. [Currying](https://monsterlessons.com/project/lessons/karrirovanie-currying-v-javascript)
1. [`curry` function](https://monsterlessons.com/project/lessons/pishem-funkciyu-curry-v-javascript)
> Note that any pattern can bring over complexity to your code if used unnecessarily.
Project is based on [Monster Lessons](https://monsterlessons.com/project/categories/javascript) online JS lessons.
Additional knowledge can be found in [Refactoring Guru](https://refactoring.guru/): the one-man band behind - Alexander Shvets and [Design Patterns — easier than simple](https://sites.google.com/site/designpatternseasy/) book by Andriy Buday.