0.0.1-4.8 • Published 1 year ago

angular-usestate v0.0.1-4.8

Weekly downloads
-
License
-
Repository
github
Last release
1 year 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

1 year ago

0.0.1-4.5

1 year ago

0.0.1-2.7

1 year ago

0.0.1-4.4

1 year ago

0.0.1-2.6

1 year ago

0.0.1-4.3

1 year ago

0.0.1-4.2

1 year ago

0.0.1-4.8

1 year ago

0.0.1-4.7

1 year ago

0.0.1-2.9

1 year ago

0.0.1-4.6

1 year ago

0.0.1-2.8

1 year ago

0.0.1-2.997

1 year ago

0.0.1-2.996

1 year ago

0.0.1-2.995

1 year ago

0.0.1-2.91

1 year ago

0.0.1-2.92

1 year ago

0.0.1-2.93

1 year ago

0.0.1-2.94

1 year ago

0.0.1-2.993

1 year ago

0.0.1-2.992

1 year ago

0.0.1-2.991

1 year ago

0.0.1-2.95

1 year ago

0.0.1-2.96

1 year ago

0.0.1-2.97

1 year ago

0.0.1-2.98

1 year ago

0.0.1-3.2

1 year ago

0.0.1-2.99

1 year ago

0.0.1-3.1

1 year ago

0.0.1-3.6

1 year ago

0.0.1-3.5

1 year ago

0.0.1-3.4

1 year ago

0.0.1-3.3

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.1-2.981

1 year ago

0.0.1-2.5

2 years ago

0.0.1-2.4

2 years ago

0.0.1-2.3

2 years ago

0.0.1-2.2

2 years ago

0.0.1-2.1

2 years ago

0.0.12

2 years ago

0.0.1-1.4

2 years ago

0.0.1-1.3

2 years ago

0.0.1-1.2

2 years ago

0.0.1-1.1

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago