Skip to content

Commit eae602d

Browse files
committed
Update README.md
1 parent 912f5d1 commit eae602d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Add the following script tag to your html:
4141

4242
#### Initialization
4343

44-
You can initialize ngRedux two ways:
44+
You can either pass a function or an object to `createStoreWith`.
4545

46-
Function as the reducer argument for the `createStoreWith`:
46+
With a function:
4747

4848
```JS
4949
import reducers from './reducers';
@@ -58,13 +58,14 @@ angular.module('app', [ngRedux])
5858
});
5959
```
6060

61-
A reducer object as reducer argument for the `createStoreWith`:
61+
With an object:
6262

6363
```JS
6464
import reducers from './reducers';
6565
import { combineReducers } from 'redux';
6666
import loggingMiddleware from './loggingMiddleware';
6767
import ngRedux from 'ng-redux';
68+
import reducer3 from './reducer3';
6869

6970
angular.module('app', [ngRedux])
7071
.config(($ngReduxProvider) => {
@@ -76,8 +77,7 @@ angular.module('app', [ngRedux])
7677
}, ['promiseMiddleware', loggingMiddleware]);
7778
});
7879
```
79-
80-
The object can be constructed either by passing a function as value or a string representing the reducer. This way, you can create reducers as services and initialze them inside the `.config`. Behind the secnes, ngRedux will `$injector.get` the string you pass as the value for the ojects of reducers and initilaze it.
80+
In this example `reducer1` will be resolved using angular's DI after the config phase.
8181

8282
#### Usage
8383

0 commit comments

Comments
 (0)