Skip to content

Instantly share code, notes, and snippets.

View Mohsenpoureiny's full-sized avatar
🎯
Focusing

Mohsen Poureiny Mohsenpoureiny

🎯
Focusing
View GitHub Profile
@Orbis25
Orbis25 / IRepository.ts
Created August 26, 2020 19:38
Simple Repository Pattern in TypeScript with axios
import { AxiosResponse } from "axios";
import { AxiosConfig } from "../../api";
export interface IRead<T> {
getAll(route: string, params?: string): Promise<AxiosResponse<T[]>>;
getById(route: string, id: string): Promise<AxiosResponse<T>>;
getPaginatedList(route: string, params?: string): Promise<AxiosResponse<T[]>>;
}
export interface IWrite<T> {