You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
433 B
21 lines
433 B
import assign from './assign';
|
|
/**
|
|
* @private
|
|
* simple class inheritance
|
|
* @param {Function} child
|
|
* @param {Function} base
|
|
* @param {Object} [properties]
|
|
*/
|
|
export default function inherit(child, base, properties) {
|
|
let baseP = base.prototype;
|
|
let childP;
|
|
|
|
childP = child.prototype = Object.create(baseP);
|
|
childP.constructor = child;
|
|
childP._super = baseP;
|
|
|
|
if (properties) {
|
|
assign(childP, properties);
|
|
}
|
|
}
|