If you were working before with Angular or Mobx, you already somewhat familiar with decorators as they make heavy use of them. They have been part of other languages for long, but they are coming to JavaScript as well.

We can already use them today with polyfillers or compilers such Babel. If you are not familiar with decorators, we are talking about the following:

Experimental decorators

Here @observable is a decorator, which is responsible for wrapping the two properties with additional functionality. So how are they created? Let’s first take a step back and define what design patterns are in general.


The Decorator Design Pattern in JavaScript

#javascript #web-development #frontend #decorators #design-pattern #webtips

The Decorator Design Pattern in JavaScript
1.40 GEEK