Skip to content

Commit 523fb89

Browse files
Merge pull request #3 from SethDavenport/chore/rename
Adapt to org rename. See angular-redux/store#304
2 parents 2286895 + dd67393 commit 523fb89

File tree

11 files changed

+6937
-29
lines changed

11 files changed

+6937
-29
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
## ng2-redux-form
1+
## @angular-redux/form
22

3-
[![npm version](https://img.shields.io/npm/v/ng2-redux-form.svg)](https://www.npmjs.com/package/ng2-redux-form)
4-
[![npm downloads](https://img.shields.io/npm/dt/ng2-redux-form.svg)](https://www.npmjs.com/package/ng2-redux-form)
3+
[![npm version](https://img.shields.io/npm/v/@angular-redux/form.svg)](https://www.npmjs.com/package/@angular-redux/form)
54

6-
This library is a thin layer of connective tissue between Angular 2 forms and
5+
This library is a thin layer of connective tissue between Angular 2+ forms and
76
Redux. It provides unidirectional data binding between your Redux state and
87
your forms elements. It builds on existing Angular functionality like
98
[NgModel](https://angular.io/docs/ts/latest/api/forms/index/NgModel-directive.html)
@@ -51,7 +50,7 @@ the class that is responsible for connecting your forms to your Redux state.
5150
There are two ways of doing this: either using an `Redux.Store<T>` object or
5251
an `NgRedux<T>` object. There are no substantial differences between these
5352
approaches, but if you are already using
54-
[ng2-redux](https://github.com/angular-redux/ng2-redux) or you wish to integrate
53+
[@angular-redux/store](https://github.com/angular-redux/store) or you wish to integrate
5554
it into your project, then you would do something like this:
5655

5756
```typescript
@@ -70,11 +69,11 @@ it into your project, then you would do something like this:
7069
export class ExampleModule {}
7170
```
7271

73-
Or if you are using Redux without ng2-redux, then your bootstrap call would look
72+
Or if you are using Redux without `@angular-redux/store`, then your bootstrap call would look
7473
more like this (substitute your own store creation code):
7574

7675
```typescript
77-
import {provideReduxForms} from 'ng2-redux-form';
76+
import {provideReduxForms} from '@angular-redux/form';
7877

7978
const storeCreator = compose(applyMiddleware(logger))(createStore);
8079
const store = create(reducers, <MyApplicationState> {});
@@ -95,7 +94,7 @@ export class ExampleModule {}
9594
```
9695

9796
The essential bit of code in the above samples is the call to `provideReduxForms(...)`.
98-
This configures ng2-form-redux and provides access to your Redux store or NgRedux
97+
This configures `@angular-redux/form` and provides access to your Redux store or NgRedux
9998
instance. The shape of the object that `provideReduxForms` expects is very
10099
basic:
101100

@@ -200,7 +199,7 @@ the `path` property on our first `<select>` element, it would look like this:
200199
['form1', 'dependents', 0, 'type']
201200
```
202201

203-
From there, `ng2-redux-form` is able to take that path and extract the value for
202+
From there, `@angular-redux/form` is able to take that path and extract the value for
204203
that element from the Redux state.
205204

206205
#### Troubleshooting
@@ -218,14 +217,14 @@ the easy part and is unlikely to cause any problems for you. Slightly more diffi
218217
is _updating your Redux state_ when the form values change. There are two approaches
219218
that you can take in order to do this.
220219

221-
The first, and by far the simplest, is to use the reducer that comes with ng2-redux-form
220+
The first, and by far the simplest, is to use the reducer that comes with `@angular-redux/form`
222221
and uses the value supplied in `connect` and the form input names in order to update
223222
your Redux state automatically. If you do not need to do any special processing on
224223
your data when the user updates form inputs, then you should use this default reducer.
225224
To use it, you need to combine it with your existing reducers like so:
226225

227226
```typescript
228-
import {composeReducers, defaultFormReducer} from 'ng2-redux-form';
227+
import {composeReducers, defaultFormReducer} from '@angular-redux/form';
229228

230229
const reducer = composeReducers(
231230
defaultFormReducer(),
@@ -293,10 +292,10 @@ to you.
293292

294293
## Examples
295294

296-
The `examples` directory contains some examples of how to use ng2-redux-form and
295+
The `examples` directory contains some examples of how to use `@angular-redux/form` and
297296
how to connect it to your application. You may also find it useful to debug and
298297
step through the examples and the unit tests to get a better understanding of how
299298
the library works.
300299

301300
The unit tests in `*.test.ts` files also contain useful examples of how to build
302-
forms using ng2-redux-form.
301+
forms using `@angular-redux/form`.

examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"name": "ng2-redux-form-examples",
2+
"name": "@angular-redux/form-examples",
33
"engines": {
44
"node": ">=6.0"
55
},
66
"scripts": {
77
"dev": "cross-env NODE_ENV=development webpack-dev-server -d --devtool=inline-source-map --inline --progress --no-info"
88
},
99
"devDependencies": {
10+
"@angular-redux/store": "^5.1.0",
1011
"@angular/common": "^2.4.2",
1112
"@angular/compiler": "^2.4.2",
1213
"@angular/core": "^2.4.2",
@@ -16,7 +17,6 @@
1617
"babel-polyfill": "^6.20.0",
1718
"chai": "^3.5.0",
1819
"immutable": "^3.8.1",
19-
"ng2-redux": "^5.1.0",
2020
"redux": "^3.0",
2121
"redux-logger": "^2.6.1",
2222
"reflect-metadata": "^0.1.9",

examples/source/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html5>
22
<html>
33
<head>
4-
<title>ng2-redux-form examples</title>
4+
<title>@angular-redux/form examples</title>
55
</head>
66
<body>
77
<example></example>

examples/source/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
55

66
import {Map, fromJS} from 'immutable';
77

8-
import {NgRedux, select} from 'ng2-redux';
8+
import {NgRedux, select} from '@angular-redux/store';
99

1010
import {combineReducers} from 'redux';
1111

0 commit comments

Comments
 (0)