Frontend Tips 2 — Wrapping a class method using decorators with TypeScript

Quique Fdez. Guerra
3 min readJun 22, 2020

--

In this tip I want to share how to wrap your class methods using decorators, to create, for example, a log where you can see when a method is executed.

Decorators are in EcmaScript proposals but I think that will be easier to do the exercise with CodeSandbox and TypeScript.

Preparing the exercise

--

--

Quique Fdez. Guerra

Director of Engineering at @PlainConcepts Romania Frontend Developer Lazy @Github contributor Happy @Helpdev_ founder Web @GoogleDevExpert