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);