0.0.1-4.8 • Published 2 years ago

angular-usestate v0.0.1-4.8

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

angular-usestate

Aim of this library is to reduce complexity in NGRX State Management and development time and keep the focus of the developer more on Business Logic and also to make the Application intuitive and declarative in nature by reducing excessive boilerplate.

VERSION

Support for Angular V13+

NOTE

This Library is built using NRWL/NX. Install Using : npm i --legacy-peer-deps angular-usestate in case Using incompatible versions.

Install Dependencies --legacy-peer-deps

  • @ngrx/store
  • @ngrx/effects
  • @ngrx/entity
  • @ngrx/router-store

Pre-Requisite Setup in Root Module

  • StoreModule.forRoot({})
  • EffectsModule.forRoot({})
  • RouterModule.forRoot([])
  • HttpClientModule

EXAMPLE CODE

Create Simple Variable State

<ng-container  useState="mymessage"  [value]="'Hello World!!'" >
        Output : {{ 'mymessage'|readState|async }}
</ng-container>

Create NGRX Form State

 <form useFormState="biodataform" #form=useFormState > 
     <use-form-field name="firstname" label="First Name" ></use-form-field>
     <use-form-field name="lastname" label="Last Name"  ></use-form-field>
     <use-form-field name="birthdate"  fieldType="date" label="Birth Date" ></use-form-field>
     <use-form-field  #description name="description"  fieldType="any" label="Birth Date" >
         <textarea [formControl]="description.formControl"  >
         </textarea>
     </use-form-field>
 <button doPostAPIAction="savedata" [postData]="{someOtherParam:'YES'}"  (actionComplete)="alert('Saved..');" >SAVE</button>
 <button doPutAPIAction="updatedata" [postData]="{someOtherParam:'NO'}"  (actionComplete)="alert('Updated..');" >UPDATE</button>

 <button (click)="form.reset()" >RESET</button>
<hr>
 *** This will Post Data inside Form State + [postData] attribute payload to API : Amazing Ya .. 
 To Update Any State Variable You can do this  
 <button setSetAction="masters" [value]="SomeNewValue" ></button>

Contribute

Github

0.0.1-4.1

2 years ago

0.0.1-4.5

2 years ago

0.0.1-2.7

2 years ago

0.0.1-4.4

2 years ago

0.0.1-2.6

2 years ago

0.0.1-4.3

2 years ago

0.0.1-4.2

2 years ago

0.0.1-4.8

2 years ago

0.0.1-4.7

2 years ago

0.0.1-2.9

2 years ago

0.0.1-4.6

2 years ago

0.0.1-2.8

2 years ago

0.0.1-2.997

2 years ago

0.0.1-2.996

2 years ago

0.0.1-2.995

2 years ago

0.0.1-2.91

2 years ago

0.0.1-2.92

2 years ago

0.0.1-2.93

2 years ago

0.0.1-2.94

2 years ago

0.0.1-2.993

2 years ago

0.0.1-2.992

2 years ago

0.0.1-2.991

2 years ago

0.0.1-2.95

2 years ago

0.0.1-2.96

2 years ago

0.0.1-2.97

2 years ago

0.0.1-2.98

2 years ago

0.0.1-3.2

2 years ago

0.0.1-2.99

2 years ago

0.0.1-3.1

2 years ago

0.0.1-3.6

2 years ago

0.0.1-3.5

2 years ago

0.0.1-3.4

2 years ago

0.0.1-3.3

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.1-2.981

2 years ago

0.0.1-2.5

3 years ago

0.0.1-2.4

3 years ago

0.0.1-2.3

3 years ago

0.0.1-2.2

3 years ago

0.0.1-2.1

3 years ago

0.0.12

3 years ago

0.0.1-1.4

3 years ago

0.0.1-1.3

3 years ago

0.0.1-1.2

3 years ago

0.0.1-1.1

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago