Very insightful piece by Uday Hiwarale on ES Decorators (Class Method Decorators, Class Instance Field Decorators, and Class Decorators).
Right now (June 2018), Decorators are in stage 2 and we have Babel plugin to transpile decorators
babel-plugin-transform-decorators-legacy
. In stage 2, as syntax of the feature is subjected to change, it’s not recommended to use it in production as of now. In any case, decorators are beautiful and very useful to achieve things quicker.
Before going into Decorators he gives a very insightful explanation about Property Descriptors first:
To understand decorators, we need to first understand what is a property descriptor of JavaScript object property.
A minimal guide to ECMAScript Decorators (and Property Descriptors) →
Leave a comment