RIAEvangelist / awesome-webcomponents

Other
13 stars 2 forks source link

Bound callbacks are not being unbound #54

Open MaybeRex opened 8 years ago

MaybeRex commented 8 years ago

For example, when binding this to a click event listener, the listener will continue to live on after removed

attachedCallback(){
    this.addEventListener(
        'click',
        this.clicked.bind(this)
    );
}

this will not be unbound later

dettachedCallback(){
    this.removeEventListener(
        'click',
        this.clicked.bind(this)
    );
}