Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eyesofkids/f4cdd6d2a491ff6848e89581ff441d79 to your computer and use it in GitHub Desktop.
Save eyesofkids/f4cdd6d2a491ff6848e89581ff441d79 to your computer and use it in GitHub Desktop.
A simple interface for defining CRUD services
export interface ICrudService<T> {
getAll: () => Promise<T[]>;
getOne: (id: string) => Promise<T | null>;
create: (data: T) => Promise<T>;
update: (id: string, data: T) => Promise<T>;
delete: (id: string) => Promise<T>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment