check parent builder object for enabled status
This commit is contained in:
parent
5a69476142
commit
fb65f895c3
2 changed files with 35 additions and 1 deletions
14
index.js
14
index.js
|
|
@ -36,8 +36,20 @@ function build(_styles) {
|
|||
return applyStyle.apply(builder, arguments);
|
||||
};
|
||||
|
||||
var self = this;
|
||||
|
||||
builder._styles = _styles;
|
||||
builder.enabled = this.enabled;
|
||||
|
||||
Object.defineProperty(builder, 'enabled', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return self.enabled;
|
||||
},
|
||||
set: function (v) {
|
||||
self.enabled = v;
|
||||
}
|
||||
});
|
||||
|
||||
// __proto__ is used because we must return a function, but there is
|
||||
// no way to create a function with a different prototype.
|
||||
/* eslint-disable no-proto */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue