Comparing version 2.5.0 to 2.5.1
@@ -133,2 +133,4 @@ 'use strict'; | ||
value: function wrap(name, component, more) { | ||
var _this2 = this; | ||
var _ref = more || {}; | ||
@@ -138,3 +140,5 @@ | ||
return (0, _wrap3.default)(this._connectors, (0, _extend2.default)(name, component, styles, this._options)); | ||
return (0, _wrap3.default)(this._connectors, (0, _extend2.default)(name, component, styles, function () { | ||
return _this2._options; | ||
})); | ||
} | ||
@@ -141,0 +145,0 @@ }, { |
@@ -30,3 +30,3 @@ 'use strict'; | ||
function extendComponent(component, stylesDef, options) { | ||
function extendComponent(component, stylesDef, optionsGetter) { | ||
var stylesResolver = _electrumTheme.Styles.build(stylesDef); | ||
@@ -49,2 +49,3 @@ return (function (_component) { | ||
var dirty = (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState); | ||
var options = optionsGetter && optionsGetter(); | ||
if (options && options.log && options.log.shouldComponentUpdate) { | ||
@@ -51,0 +52,0 @@ options.log.shouldComponentUpdate(this, nextProps, nextState, dirty); |
@@ -28,3 +28,3 @@ 'use strict'; | ||
function extend(name, component, stylesDef, options) { | ||
function extend(name, component, stylesDef, optionsGetter) { | ||
if (typeof component !== 'function') { | ||
@@ -39,3 +39,3 @@ throw new Error('Component ' + name + ' is not defined as a function/class'); | ||
} | ||
component = (0, _extendComponent2.default)(component, stylesDef, options); | ||
component = (0, _extendComponent2.default)(component, stylesDef, optionsGetter); | ||
component = (0, _extendComponentDisplayName2.default)(component, name); | ||
@@ -42,0 +42,0 @@ return component; |
{ | ||
"name": "electrum", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "Electrum simplifies framework-agnostic declaration of React components.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -102,3 +102,3 @@ 'use strict'; | ||
const {styles} = more || {}; | ||
return wrap (this._connectors, extend (name, component, styles, this._options)); | ||
return wrap (this._connectors, extend (name, component, styles, () => this._options)); | ||
} | ||
@@ -105,0 +105,0 @@ } |
@@ -10,3 +10,3 @@ 'use strict'; | ||
export default function extendComponent (component, stylesDef, options) { | ||
export default function extendComponent (component, stylesDef, optionsGetter) { | ||
const stylesResolver = Styles.build (stylesDef); | ||
@@ -20,2 +20,3 @@ return class extends component { | ||
const dirty = shallowCompare (this, nextProps, nextState); | ||
const options = optionsGetter && optionsGetter (); | ||
if (options && options.log && options.log.shouldComponentUpdate) { | ||
@@ -22,0 +23,0 @@ options.log.shouldComponentUpdate (this, nextProps, nextState, dirty); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
export default function extend (name, component, stylesDef, options) { | ||
export default function extend (name, component, stylesDef, optionsGetter) { | ||
if (typeof component !== 'function') { | ||
@@ -21,3 +21,3 @@ throw new Error (`Component ${name} is not defined as a function/class`); | ||
} | ||
component = extendComponent (component, stylesDef, options); | ||
component = extendComponent (component, stylesDef, optionsGetter); | ||
component = extendComponentDisplayName (component, name); | ||
@@ -24,0 +24,0 @@ return component; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121397
2272