- Patterns are proven solutions
- Patterns can be easily reused
- Patterns can be expressive
This DevSnack supplies some design patterns which can be used or at least be considered for improving your JS code quality.
#1 – The Module Pattern
When coming from other languages, especially traditional object-oriented ones, prototype pattern can become a little bit confusing. @addyosmani wrote a whole chapter for it, guiding us through the road from zero to hero.
#3 – The Bridge Pattern
#4 – The Publisher Pattern
In this post @ded shows his own publisher pattern, described by himself as an “Observer Reloaded”. If I were you I would take a look at it, it’s always nice to learn from the big fish.
#5 – The Factory Pattern
Being used by a lot of JS frameworks, it is really useful to understand the factory pattern in depth. @carldanley published a short article about it, which I highly recommend.
DevSnack by Moove-it is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.