ember-redux
Advanced tools
Comparing version 1.7.0 to 1.8.0
import Ember from 'ember'; | ||
import shallowEqual from '../-private/equal'; | ||
const { computed, defineProperty } = Ember; | ||
const { computed, defineProperty, run } = Ember; | ||
@@ -47,9 +46,13 @@ var connect = function(mapStateToComputed, mapDispatchToActions) { | ||
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); | ||
} | ||
run(() => { | ||
var redux = this.get('redux'); | ||
var props = mapState(redux.getState()); | ||
var componentState = this.getComponentState(props); | ||
var reduxState = finalMapStateToComputed(redux.getState()); | ||
props.forEach((name) => { | ||
if (componentState[name] !== reduxState[name]) { | ||
this.updateProps(name); | ||
} | ||
}); | ||
}); | ||
}, | ||
@@ -63,8 +66,7 @@ getComponentState(props) { | ||
}, | ||
updateProps(props) { | ||
props.forEach((name) => { | ||
this.notifyPropertyChange(name); | ||
}); | ||
updateProps(name) { | ||
this.notifyPropertyChange(name); | ||
}, | ||
willDestroy() { | ||
this._super(...arguments); | ||
if (this.unsubscribe) { | ||
@@ -71,0 +73,0 @@ this.unsubscribe(); |
ember-redux Changelog | ||
============================== | ||
1.8.0 | ||
----- | ||
* [PERFORMANCE]: Avoid unnecessary notifyPropertyChange work | ||
([#38](https://github.com/toranb/ember-redux/pull/38)) | ||
* [BUG]: wrap handleChange callback with Ember.run | ||
([#35](https://github.com/toranb/ember-redux/pull/35)) | ||
* [BUG]: Call super in component willDestroy | ||
([#31](https://github.com/toranb/ember-redux/pull/31)) | ||
* [DOCS]: added yelp clone ember-twiddle example | ||
([commit](https://github.com/toranb/ember-redux/commit/4f0160fde1a09f076fd89b7af6e6c8a017e450ed)) | ||
1.7.0 | ||
@@ -5,0 +21,0 @@ ----- |
{ | ||
"name": "ember-redux", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "ember-cli addon that provides simple redux bindings for ember.js", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -21,4 +21,8 @@ # Ember Redux | ||
Counting Example (simple) | ||
https://ember-twiddle.com/7ce3446b14f166f04064eba663c0a350 | ||
Yelp Clone (complex) | ||
https://ember-twiddle.com/64b18c23223fbc1f3a7da8171c6d8881 | ||
## Example Container Component | ||
@@ -25,0 +29,0 @@ |
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
15947
121
15
177