The target constructor to inherit static members.
The source constructor to copy static members from.
An optional array of keys to exclude from copying.
The target constructor with the inherited static members.
If target
or source
is not a constructor.
class Parent {
static parentStaticMethod() {
return 'Parent static method'
}
}
class Child {
static childStaticMethod() {
return 'Child static method'
}
}
inheritStaticMembers(Child, Parent)
Child.parentStaticMethod() //=> 'Parent static method'
Generated using TypeDoc
Copies static members from a source constructor to a target constructor, excluding specified keys.