When we use NGRX, we need to create some bolipates. Now with Angulalr6, we can use CLI to generate those code for us.

Install:

@ngrx/schematics: Scaffolding library for Angular applications using NgRx.

npm install @ngrx/schematics --save-dev
npm install @ngrx/{store,effects,entity,store-devtools} --save

Config:

ng config cli.defaultCollection @ngrx/schematics

Create a root store:

ng generate store State --root --module app.module.ts

Create a feature store:

ng g feature travel/store/Travel --group true --module travel/travel.module.ts

The structure we want is like:

[Angulalr] Speed Up Reducer Development Using Ngrx Schematics-LMLPHP

[Angulalr] Speed Up Reducer Development Using Ngrx Schematics-LMLPHP

05-28 21:54