ember-redux
Advanced tools
Comparing version 1.5.3 to 1.6.0
import Ember from 'ember'; | ||
import shallowEqual from '../-private/equal'; | ||
@@ -41,10 +42,27 @@ const { computed, defineProperty } = Ember; | ||
if (shouldSubscribe && !this.unsubscribe) { | ||
this.unsubscribe = redux.subscribe(() => { | ||
props.forEach(function(name) { | ||
component.notifyPropertyChange(name); | ||
}); | ||
}); | ||
this.unsubscribe = redux.subscribe(this.handleChange.bind(this)); | ||
} | ||
this._super(...arguments); | ||
}, | ||
handleChange() { | ||
var redux = this.get('redux'); | ||
var props = mapState(redux.getState()); | ||
var componentState = this.getComponentState(props); | ||
var reduxState = finalMapStateToComputed(redux.getState()); | ||
if (!shallowEqual(componentState, reduxState)) { | ||
this.updateProps(props); | ||
} | ||
}, | ||
getComponentState(props) { | ||
var componentState = {}; | ||
props.forEach((name) => { | ||
componentState[name] = this.get(name); | ||
}); | ||
return componentState; | ||
}, | ||
updateProps(props) { | ||
props.forEach((name) => { | ||
this.notifyPropertyChange(name); | ||
}); | ||
}, | ||
willDestroy() { | ||
@@ -51,0 +69,0 @@ if (this.unsubscribe) { |
ember-redux Changelog | ||
============================== | ||
1.6.0 | ||
----- | ||
* [PERFORMANCE]: only notifyPropertyChange when a value is diff between redux and component | ||
([#23](https://github.com/toranb/ember-redux/pull/23)) | ||
1.5.3 | ||
@@ -5,0 +12,0 @@ ----- |
{ | ||
"name": "ember-redux", | ||
"version": "1.5.3", | ||
"version": "1.6.0", | ||
"description": "ember-cli addon that provides simple redux bindings for ember.js", | ||
@@ -5,0 +5,0 @@ "directories": { |
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
140907
19
183