19 lines
471 B
JavaScript
19 lines
471 B
JavaScript
![]() |
import Pattern from "./pattern";
|
||
|
|
||
|
export default function Design(config, plugins = false) {
|
||
|
const pattern = function(settings) {
|
||
|
Pattern.call(this, config);
|
||
|
if (Array.isArray(plugins)) for (let plugin of plugins) this.use(plugin);
|
||
|
if (plugins) this.use(plugins);
|
||
|
this.apply(settings);
|
||
|
|
||
|
return this;
|
||
|
};
|
||
|
|
||
|
// Set up inheritance
|
||
|
pattern.prototype = Object.create(Pattern.prototype);
|
||
|
pattern.prototype.constructor = pattern;
|
||
|
|
||
|
return pattern;
|
||
|
}
|