bind-decorator icon indicating copy to clipboard operation
bind-decorator copied to clipboard

question: Does this decorator bind to the class instance, or to its prototype?

Open SanderElias opened this issue 6 years ago • 0 comments

The ts docs mention:

Either the constructor function of the class for a static member, or the prototype of the class for an instance member.

As a long time JS user, this continues to confuse me;) For classes you only create a single instance from, this is a non-issue. However, if you create multiple instances of the same class, this might turn out to be the wrong this, and create very hard to find bugs.

SanderElias avatar Oct 10 '18 08:10 SanderElias