- 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
@toddmotto exposes the Module Pattern in a vast way, being a must-know pattern for every JS developer. This post is of great help for beginners who don’t know much about it.
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.