bem-bl
bem-bl copied to clipboard
i-bem__dom: afterCurrentEvent should guarantee block existence
It's a common case in our BEMDOM blocks to have a code like this:
// myblock.js
this.afterCurrentEvent(function() {
this.domElem && this.doSomething();
});
We defiantly should make the kind of check like the one above as i-bem__dom
functionality as we did with i-bem
in bem-core library.
NOTE: this.domElem
is the only true way to check if block still haven't been destructed (#507).
BEM-2124