2019-02-16 07:28:56 +01:00
|
|
|
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);
|
2019-04-13 14:12:54 +02:00
|
|
|
else if (plugins) this.use(plugins);
|
2019-02-16 07:28:56 +01:00
|
|
|
this.apply(settings);
|
|
|
|
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Set up inheritance
|
|
|
|
pattern.prototype = Object.create(Pattern.prototype);
|
|
|
|
pattern.prototype.constructor = pattern;
|
|
|
|
|
|
|
|
return pattern;
|
|
|
|
}
|