forked from NetanelBasal/ngrx-generator
-
Notifications
You must be signed in to change notification settings - Fork 5
Architecture
kmathy edited this page Jan 1, 2018
·
5 revisions
Section that explain the different architectures
The first time you launch the generator, 3 main files are created:
- all-effects.ts - Contains all the imports of @ngrx/effects and export an array of these to easily provide them in the EffectModule.
- app.store.ts - Contains the interface State for the typing, the imported reducers to provide to the StoreModule of @ngrx/store + the custom meta-reducers.
- StoreReduxor.module.ts - Module wrapper importing and configuring @ngrx
The first generator available is Basic. It only creates a new action based on the Angular HTTP service, if you just need to load something or customize it to your needs. You can find an example here
This provides a more advanced structure to manage entities using Angular HTTP services. We can Create, Read, Update and Delete any object with this structure. You can find an example here
If you choose CRUD, you will have the possibility to generate a @ngrx/entity. It is more advanced than the first one, and provide an easy way to manage the entity. You must use a singular name for the object. You can find an example here