Like in which hook of the component the function was called ?
I need to assert that a function in my mixin is invoked only in the didInsertElement() hook and not before, so that the function could handle the DOM.
Like in which hook of the component the function was called ?
I need to assert that a function in my mixin is invoked only in the didInsertElement() hook and not before, so that the function could handle the DOM.
You could check if this.element
is in the dom like document.contains(this.element)
.
I have created a twiddle, this details you how to check if a function is called directly from didInsertElement. (This method uses error stack)
reference: How do you find out the caller function in JavaScript?