Skip to content

Commit 84d06e3

Browse files
committed
Update README.md
1 parent 5b8382d commit 84d06e3

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
For Angular 2 see [ng2-redux](https://github.com/wbuchwalter/ng2-redux).
55

6-
**Warning: The API will be subject to breaking changes until `1.0.0` is released.**
7-
86
[![build status](https://img.shields.io/travis/wbuchwalter/ng-redux/master.svg?style=flat-square)](https://travis-ci.org/wbuchwalter/ng-redux)
97
[![npm version](https://img.shields.io/npm/v/ng-redux.svg?style=flat-square)](https://www.npmjs.com/package/ng-redux)
108

@@ -21,7 +19,6 @@ For Angular 2 see [ng2-redux](https://github.com/wbuchwalter/ng2-redux).
2119

2220
## Installation
2321

24-
**The current npm version is outdated, and will be updated once 1.0.0 is finished**
2522
```js
2623
npm install --save ng-redux
2724
```
@@ -44,7 +41,6 @@ angular.module('app', ['ngRedux'])
4441
```
4542

4643
#### Usage
47-
*Note: this sample is using the ControllerAs syntax, usage is slightly different without ControllerAs, see API section for more details*
4844

4945
```JS
5046
import * as CounterActions from '../actions/counter';
@@ -54,7 +50,7 @@ class CounterController {
5450
/* ngRedux will merge the requested state's slice and actions onto the $scope,
5551
you don't need to redefine them in your controller */
5652

57-
$ngRedux.connect($scope, this.mapStateToScope, CounterActions, 'vm');
53+
$ngRedux.connect($scope, this.mapStateToScope, CounterActions);
5854
}
5955

6056
// Which part of the Redux global state does our component want to receive on $scope?
@@ -88,18 +84,17 @@ Creates the Redux store, and allow `connect()` to access it.
8884
* [`storeEnhancers`] \(*Function[]*): Optional, this will be used to create the store, in most cases you don't need to pass anything, see [Store Enhancer official documentation.](http://rackt.github.io/redux/docs/Glossary.html#store-enhancer)
8985

9086

91-
### `connect([scope], [mapStateToScope], [mapDispatchToScope], [propertyKey])`
87+
### `connect([scope], [mapStateToScope], [mapDispatchToScope])`
9288

9389
Connects an Angular component to Redux.
9490

9591
#### Arguments
9692
* [`scope`] \(*Object*): The `$scope` of your controller.
9793
* [`mapStateToScope`] \(*Function*): connect will subscribe to Redux store updates. Any time it updates, mapStateToTarget will be called. Its result must be a plain object, and it will be merged into `target`.
9894
* [`mapDispatchToScope`] \(*Object* or *Function*): If an object is passed, each function inside it will be assumed to be a Redux action creator. An object with the same function names, but bound to a Redux store, will be merged into your component `$scope`. If a function is passed, it will be given `dispatch`. It’s up to you to return an object that somehow uses `dispatch` to bind action creators in your own way. (Tip: you may use the [`bindActionCreators()`](http://gaearon.github.io/redux/docs/api/bindActionCreators.html) helper from Redux.).
99-
* [`propertyKey`] \(*string*): If provided, `mapStateToScope` and `mapDispatchToScope` will merge onto `$scope[propertyKey]`. This is needed especially when using the `ControllerAs` syntax: in this case you should provide the same value than the value provided to controllerAs (e.g: `'vm'`). When not using `ControllerAs` syntax, you are free to omit this argument, everything will be merged directly onto `$scope`.
10095

10196
#### Remarks
102-
As `$scope` is passed to `connect`, ngRedux will listen to the `$destroy` event and unsubscribe the change listener itself, you don't need to keep track of your subscribtions.
97+
* As `$scope` is passed to `connect`, ngRedux will listen to the `$destroy` event and unsubscribe the change listener itself, you don't need to keep track of your subscribtions.
10398

10499
### Store API
105100
All of redux's store methods (i.e. `dispatch`, `subscribe` and `getState`) are exposed by $ngRedux and can be accessed directly. For example:

0 commit comments

Comments
 (0)