bind-decorator
bind-decorator copied to clipboard
question: Does this decorator bind to the class instance, or to its prototype?
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.