From 87e481128402deb75e3d3e36fced318047ac1153 Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Fri, 18 Sep 2015 20:31:52 +0200 Subject: [PATCH] Fix the mapping state from the counter example --- README.md | 8 ++++---- examples/counter/components/counter.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fba2416..788b58b 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,14 @@ class CounterController { /* ngRedux will merge the requested state's slice and actions onto this, you don't need to redefine them in your controller */ - let unsubscribe = $ngRedux.connect(this.mapStateToTarget, CounterActions)(this); + let unsubscribe = $ngRedux.connect(this.mapStateTothis, CounterActions)(this); $scope.$on('$destroy', unsubscribe); } - // Which part of the Redux global state does our component want to receive on $scope? - mapStateToTarget(state) { + // Which part of the Redux global state does our component want to receive? + mapStateToThis(state) { return { - counter: state.counter + value: state.counter }; } } diff --git a/examples/counter/components/counter.js b/examples/counter/components/counter.js index f6d69c2..53fa5f1 100644 --- a/examples/counter/components/counter.js +++ b/examples/counter/components/counter.js @@ -13,12 +13,12 @@ export default function counter() { class CounterController { constructor($ngRedux, $scope) { - const unsubscribe = $ngRedux.connect(this.mapStateToScope, CounterActions)(this); + const unsubscribe = $ngRedux.connect(this.mapStateToThis, CounterActions)(this); $scope.$on('$destroy', unsubscribe); } - // Which part of the Redux global state does our component want to receive on $scope? - mapStateToScope(state) { + // Which part of the Redux global state does our component want to receive? + mapStateToThis(state) { return { counter: state.counter };