laghaie-repository
v1.1.3
Published
generic repository pattern
Downloads
14
Readme
Repository Package for building CRUD service
Features
This package enable to persists data in (Map, LocalStorage)
Map Functions
getById
for retriveing one Itemadd
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);