diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c42b42ed5e..915a5e3e8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,26 +6,46 @@ npm install ``` +OR +``` +yarn +``` + ### Testing ``` npm test ``` +OR + +``` +yarn test +``` + ## Submitting Pull Requests **Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.** * Please rebase your branch against the current master -* Run ```npm install``` to make sure your development dependencies are up-to-date +* Run the `Setup` command to make sure your development dependencies are up-to-date * Please ensure the test suite passes before submitting a PR * If you've added new functionality, **please** include tests which validate its behavior * Make reference to possible [issues](https://github.com/ngrx/platform/issues) on PR comment ## Submitting bug reports -* Please detail the affected browser(s) and operating system(s) -* Please be sure to state which version of node **and** npm you're using +* Search through issues to see if a previous issue has already been reported and/or fixed. +* Provide a _small_ reproduction using a [plunker template](http://plnkr.co/edit/tpl:757r6L?p=preview) or github repo. +* Please detail the affected browser(s) and operating system(s). +* Please be sure to state which version of Angular, node and npm you're using. + +## Submitting New features + +* We value keeping the API surface small and concise, which factors into whether new features are accepted. +* Submit an issue with the prefix `RFC: ` with your feature request. +* The feature will be discussed and considered. +* Once the PR is submitted, it will be reviewed and merged once approved. ## Financial contributions @@ -63,4 +83,4 @@ Thank you to all our sponsors! (please ask your company to also support this ope - \ No newline at end of file + diff --git a/README.md b/README.md index b5f31f67b8..8c14414609 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Reactive libraries for Angular - [@ngrx/store-devtools](./docs/store-devtools/README.md) - Store instrumentation that enables a [powerful time-travelling debugger](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en). +## Examples +- [example-app](./example-app/README.md) - Example application utilizing @ngrx libraries, showcasing common patterns and best practices. + ## Migration - [Migration guide](./MIGRATION.md) for users of ngrx packages prior to 4.x. diff --git a/docs/store/api.md b/docs/store/api.md index 7d7758c0ec..b908e12713 100644 --- a/docs/store/api.md +++ b/docs/store/api.md @@ -49,7 +49,7 @@ export function getInitialState() { configuration option to provide an array of meta-reducers that are composed from right to left. ```ts -import { StoreModule, ActionReducer } from '@ngrx/store'; +import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store'; import { reducers } from './reducers'; // console.log all actions @@ -62,7 +62,7 @@ export function debug(reducer: ActionReducer): ActionReducer { } } -export const metaReducers = [debug]; +export const metaReducers: MetaReducer = [debug]; @NgModule({ imports: [ @@ -81,17 +81,23 @@ and `metaReducers` configuration options are available. ```ts // feature.module.ts -import { StoreModule } from '@ngrx/store'; -import { reducers } from './reducers'; +import { StoreModule, ActionReducerMap } from '@ngrx/store'; + +export const reducers: ActionReducerMap = { + subFeatureA: featureAReducer, + subFeatureB: featureBReducer, +}; @NgModule({ imports: [ - StoreModule.forFeature('featureName', reducers, { }) + StoreModule.forFeature('featureName', reducers) ] }) export class FeatureModule {} ``` +The feature state is added to the global application state once the feature is loaded. The feature state can then be selected using the [./selectors.md#createFeatureSelector](createFeatureSelector) convenience method. + ## Injecting Reducers To inject the root reducers into your application, use an `InjectionToken` and a `Provider` to register the reducers through dependency injection. diff --git a/docs/store/selectors.md b/docs/store/selectors.md index 88ce664417..322c7b6f38 100644 --- a/docs/store/selectors.md +++ b/docs/store/selectors.md @@ -51,7 +51,7 @@ class MyAppComponent { ## createFeatureSelector -The `createFeatureSelector` methods returns a selector function for a feature slice of state. +The `createFeatureSelector` is a convenience method for returning a top level feature state. It returns a typed selector function for a feature slice of state. ### Example diff --git a/example-app/README.md b/example-app/README.md index e4b13a61cd..ed59e3ee39 100644 --- a/example-app/README.md +++ b/example-app/README.md @@ -32,7 +32,10 @@ npm install yarn # start the server -npm run example:start +npm run build && npm run cli -- serve + +# OR +yarn run example:start ``` Navigate to [http://localhost:4200/](http://localhost:4200/) in your browser diff --git a/example-app/app/auth/components/login-form.component.ts b/example-app/app/auth/components/login-form.component.ts index 8023b2f516..dd99ec77ec 100644 --- a/example-app/app/auth/components/login-form.component.ts +++ b/example-app/app/auth/components/login-form.component.ts @@ -71,9 +71,9 @@ export class LoginFormComponent implements OnInit { set pending(isPending: boolean) { if (isPending) { this.form.disable(); + } else { + this.form.enable(); } - - this.form.enable(); } @Input() errorMessage: string | null;