You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where `selector` is a function that takes Redux's entire store state as argument and returns an object that contains the slices of store state that your component is interested in.
@@ -34,9 +34,8 @@ If you haven't, check out [reselect](https://github.com/faassen/reselect), an aw
34
34
35
35
This returned object will be passed as argument to the callback provided whenever the state changes.
36
36
ngRedux checks for shallow equality of the state's selected slice whenever the Store is updated, and will call the callback only if there is a change.
37
-
##### Important: It is assumed that you never mutate your states, if you do mutate them, ng-redux will not execute the callback properly.
37
+
**Important: It is assumed that you never mutate your states, if you do mutate them, ng-redux will not execute the callback properly.**
38
38
See [Redux's doc](http://gaearon.github.io/redux/docs/basics/Reducers.html) to understand why you should not mutate your states.
39
-
If you have a good reason to mutate your states, you can still [disable caching](#Disable-caching) altogether.
40
39
41
40
42
41
## Getting Started
@@ -87,14 +86,14 @@ class TodoLoaderController {
87
86
}
88
87
```
89
88
90
-
##### Note: The callback provided to ```connect``` will be called once directly after creation to allow initialization of your component states
89
+
**Note: The callback provided to `connect` will be called once directly after creation to allow initialization of your component states**
91
90
92
91
93
92
94
93
You can also grab multiple slices of the state by passing an array of selectors:
95
94
96
95
```JS
97
-
constructor(reduxConnector) {
96
+
constructor($ngRedux) {
98
97
this.todos= [];
99
98
this.users= [];
100
99
$ngRedux.connect(state=> ({
@@ -115,9 +114,9 @@ You can close a connection like this:
Each time Redux's Store update, ng-redux will check if the slices specified via 'selectors' have changed, and if so will execute the provided callback.
140
-
You can disable this behaviour, and force the callback to be executed even if the slices didn't change by setting ```disableCaching``` to true:
0 commit comments