1
0
Fork 0

💥 pattern.with() is nowy pattern.use()

This commit is contained in:
Joost De Cock 2018-12-22 10:27:05 +01:00
parent d07067e593
commit 6ad8cb6cb0
5 changed files with 6 additions and 6 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "freesewing", "name": "freesewing",
"version": "0.24.0", "version": "0.25.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View file

@ -1,6 +1,6 @@
{ {
"name": "freesewing", "name": "freesewing",
"version": "0.24.0", "version": "0.25.0",
"description": "A library for creating made-to-measure sewing patterns", "description": "A library for creating made-to-measure sewing patterns",
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)", "author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/", "homepage": "https://freesewing.org/",

View file

@ -333,7 +333,7 @@ Pattern.prototype.on = function(hook, method, data) {
this.hooks[hook].push({ method, data }); this.hooks[hook].push({ method, data });
}; };
Pattern.prototype.with = function(plugin, data = false) { Pattern.prototype.use = function(plugin, data = false) {
this.debug({ this.debug({
type: "success", type: "success",
label: "🔌 Plugin loaded", label: "🔌 Plugin loaded",

View file

@ -39,7 +39,7 @@ it("Should register and run a macro", () => {
} }
} }
}; };
pattern.with(plugin); pattern.use(plugin);
let part = new pattern.Part(); let part = new pattern.Part();
let macro = part.macroClosure(); let macro = part.macroClosure();
macro("test", { x: 123, y: 456 }); macro("test", { x: 123, y: 456 });

View file

@ -284,7 +284,7 @@ it("Should register a hook from a plugin", () => {
} }
} }
}; };
pattern.with(plugin); pattern.use(plugin);
pattern.draft(); pattern.draft();
expect(count).to.equal(1); expect(count).to.equal(1);
}); });
@ -307,7 +307,7 @@ it("Should register multiple methods on a single hook", () => {
] ]
} }
}; };
pattern.with(plugin); pattern.use(plugin);
pattern.draft(); pattern.draft();
expect(count).to.equal(2); expect(count).to.equal(2);
}); });