1.0.2 • Published 4 years ago

nekousama-state-management v1.0.2

Weekly downloads
8
License
-
Repository
-
Last release
4 years ago

LibStore

Purpose

Manage data through component in Angular application

Install

npm install nekousama-lib-store

How to use

Architecture

alt

2 Types

alt

  • Store: to store any value/object with a key
  • EntityStore: to store data from the same entity/model

Store

You can extend the 3 following classes:

  • Store
  • Service
  • Query

Entity Store

You can extend the 3 following classes:

  • EntityStore
    • By default the key used is id, you can override this in the constructor
  • EntityService
  • EntityQuery
    • By default the sort is done with the key id, you can override this in the constructor

Best practices

  • Name should be in singular (eg: store every projects -> ProjectStore, ProjectQuery, ProjectService)

Develop this bundle

This library was generated with Angular CLI version 9.0.0.

Code scaffolding

Run ng generate component component-name --project lib-store to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project lib-store.

Note: Don't forget to add --project lib-store or else it will be added to the default project in your angular.json file.

Build

Run ng build lib-store to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build lib-store, go to the dist folder cd dist/lib-store and run npm publish.

Running unit tests

Run ng test lib-store to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.