-
Notifications
You must be signed in to change notification settings - Fork 175
Closed
Description
Hi all, I'd like some implementation advices please :).
So let's say that I have this basic implementation:
constructor($ngRedux, $scope) {
let unsubscribe = $ngRedux.connect(this.mapThisToState)(this);
$scope.$on('$destroy', unsubscribe);
}
mapThisToState(state) {
return {
error: state.error
};
}
How can I do to watch for changes on the error
object from the state. I know that the mapThisToState
method is triggered every time the state changes but is it a good practice to add logic in it like:
mapThisToState(state) {
if(state.error === 'error') { this.doSomeStuff(); }
return {
error: state.error
};
}
Thanks!
Metadata
Metadata
Assignees
Labels
No labels