Skip to content

Instantly share code, notes, and snippets.

View ronak-lm's full-sized avatar

Ronak M. ronak-lm

View GitHub Profile
@ronak-lm
ronak-lm / app-fetch.ts
Created September 21, 2025 10:43
Fetch Wrapper for Error Handling
export type AppFetchResponse<T> = {
response?: Response;
data?: T;
};
export const appFetch = async <T>(
input: string,
init: RequestInit = {},
): Promise<AppFetchResponse<T>> => {
// Get the access token from local storage