💥 pattern.with() is nowy pattern.use()
This commit is contained in:
parent
d07067e593
commit
6ad8cb6cb0
5 changed files with 6 additions and 6 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -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": {
|
||||||
|
|
|
@ -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/",
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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 });
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue