[Angulalr] Speed Up Reducer Development Using Ngrx Schematics

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:

 

posted @ 2018-05-28 01:52  Zhentiw  阅读(360)  评论(0编辑  收藏  举报