NgStator
NgStator is a VERY OPINIATED ngrx toolbox to wrap most common behaviours used in an ngrx store.
what it does
-
It can create actions, initial state, selectors and reducers to manage the state of either a list, or an form
-
Its main goal is to provide a simple common ground for ngrx managed lists and forms in your app, without knowledge of your models
-
It is available as a library, but it can also easily be copied in your project, for a better customization
what it does not
-
It does not create any ngrx effects
-
It has a very minimal knowledge of your pagination and validation system
-
It certainly breaks multiple ngrx paradigms, in exchange for a simpler boilerplate
Install
npm install --save ng-stator
List slice
; // actions.ts;;// build actions creators// [LoadListRequest] Todos// [LoadListSuccess] Todos :: props<{ list: Todo[] }>// [LoadListFailure] Todos :: props<{ error: Error }>//// pagination & filtering actions are also available
// reducer.ts // handle each actions to alter the todosList slice;
// selectors.ts; ;
Entity slice
; // actions.ts;;// build actions creators// [LoadEntityRequest] Todo Form// [LoadEntitySuccess] Todo Form :: props<{ entity: Todo }>// [LoadEntityFailure] Todo Form :: props<{ error: Error }>//// confirmation actions are also available