add createParam + createParams
This commit is contained in:
parent
cdc068bb47
commit
e7def57c5b
1 changed files with 9 additions and 0 deletions
|
|
@ -291,4 +291,13 @@ generic_params.forEach(([type, name, description]) => {
|
|||
Pattern.prototype[name] = _setter(controls[name]);
|
||||
});
|
||||
|
||||
// create custom param
|
||||
controls.createParam = (name) => {
|
||||
Pattern.prototype[name] = _setter(controls[name]);
|
||||
return (...pats) => _name(name, ...pats);
|
||||
};
|
||||
|
||||
controls.createParams = (...names) =>
|
||||
names.reduce((acc, name) => Object.assign(acc, { [name]: createParam(name) }), {});
|
||||
|
||||
export default controls;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue