A workaround for a Corpuscule-decorated class inheritance. Corpuscule
decorators applied to a class override user-defined Custom Elements
lifecycle hooks like connectedCallback
etc. creating an internal worker
method which is necessary for Corpuscule elements to work correctly.
However, if the user wants to extend the class, the wrapper is unnecessary
and could cause undefined behavior and harm the runtime execution.
This function is a solution to this problem. It replaces a lifecycle hook with a wrapper that calls two different methods depending on whether the class is extended or not. If the class is not extended, the Corpuscule worker is called; otherwise, the original user-defined method is used.
a class declaration which lifecycle hooks should be redefined to be extendable.
an object with methods that should be used in case the class is not extended.
an object with methods that should be used in case the class is extended.
an array of functions to register the function to execute during the class instantiation.
Generated using TypeDoc
This module provides tools to work with restrictions of the Custom Elements spec.
Usage
import defineExtendable from '@corpuscule/utils/lib/defineExtendable'