You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stateful#observe() and Destroyable#own() automatically bind the callback to this... which was a nice feature until ES6 came along.
Now, code like this has unexpected results:
const MyClass = dcl (null, {
myWidget: ...,
myMethod: function () {
this.myWidget.observe(props => console.log(this));
}
}
```
In the above code it's natural to assume that the `console.log(this)` will print`MyClass`, but it actually refers to `myWidget`,
The text was updated successfully, but these errors were encountered:
Stateful#observe() and Destroyable#own() automatically bind the callback to
this
... which was a nice feature until ES6 came along.Now, code like this has unexpected results:
The text was updated successfully, but these errors were encountered: