laghaie-repository
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Repository Package for building CRUD service

Features

This package enable to persists data in (Map, LocalStorage)

Map Functions

  • getById for retriveing one Item
  • add for adding one Item

Full examples

import { Entity, MapRepository } from "laghaie-repository";

class Profile implements Entity<number>{
    constructor(
        public id: number,
        public fullName: string) { }
}

class ProfileMapRepository extends MapRepository<number, Profile>{

}


let repository = new ProfileMapRepository();
repository.add(new Profile(1, 'faraz laghaie'));

let profile = repository.get(2);

console.log(profile);

Package Sidebar

Install

npm i laghaie-repository

Weekly Downloads

3

Version

1.1.3

License

MIT

Unpacked Size

5 kB

Total Files

15

Last publish

Collaborators

  • laghaie