@simple-persist/angular
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

SimplePersist Angular

SimplePersist decorator to handle Angular forms

Table of Contents

Installation

npm install @simple-persist/angular

Quick start

Add @PersistControl() decorator to a FormGroup or FormControl class property:

import { PersistControl } from '@simple-persist/angular';
import { FormControl, FormGroup } from '@angular/forms';

class Foo {
  @PersistControl() public bar?: FormGroup;
  // or
  @PersistControl() public baz?: FormControl;
}

Note: All configuration options of @Persist() from @simple-persist/core are available for @PersistControl() as well. Use the same syntax to define custom keygens, middlewares or storage for your decorator!

Read more

For more information (caveats, advanced use, other extensions) see @simple-persist/core.

Check out my article about the reasoning behind this package: Do we need state management in Angular?

Collaboration

Feel free to suggest features, open issues, or contribute! Also let me know about your extensions, so I can link them in this document.

Package Sidebar

Install

npm i @simple-persist/angular

Weekly Downloads

0

Version

0.1.0

License

ISC

Unpacked Size

22.6 kB

Total Files

11

Last publish

Collaborators

  • kobalazs