@nrwl/angular:ngrx

Adds NgRx support to an application or library.

Usage

nx generate ngrx ...

By default, Nx will search for ngrx in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nrwl/angular:ngrx ...

Show what will be generated without writing to disk:

nx g ngrx ... --dry-run

Options

barrels

boolean
Default: false

Use barrels to re-export actions, state and selectors.

directory

string
Default: +state

The name of the folder used to contain/group the generated NgRx files.

facade

boolean
Default: false

Create a Facade class for the the feature.

module

Required
string

The path to the NgModule where the feature state will be registered. The host directory will create/use the new state directory.

minimal

boolean
Default: true

Only register the root state management setup or feature state.

name

Required
string

Name of the NgRx feature state, such as products or users. Recommended to use the plural form of the name.

root

boolean
Default: false

Setup root or feature state management with NgRx.

skipImport

boolean
Default: false

Generate NgRx feature files without registering the feature in the NgModule.

skipFormat

boolean
Default: false

Skip formatting files.

skipPackageJson

boolean
Default: false

Do not update the package.json with NgRx dependencies.

syntax

Deprecated
string
Default: creators
Accepted values: classes, creators

Specifies whether to use class-based or creator functions for actions, reducers, and effects.

Classes syntax is deprecated and this option will be removed in v15. Creators syntax will be the default in v15 and this option will be removed.

useDataPersistence

Deprecated
boolean
Default: false

Generate NgRx Effects with the DataPersistence helper service. Set to false to use plain effects data persistence operators.

This option is deprecated and will be removed in v15. Using the individual operators is recommended.