Skip to content

Instantly share code, notes, and snippets.

View heroneto's full-sized avatar

Heron Eto heroneto

  • Itaú
  • São Paulo
View GitHub Profile
@NoriSte
NoriSte / redux-saga-typeguard.ts
Last active November 1, 2023 02:22
Redux-saga + Typescript: implementing typeguard for Axios AJAX requests
import { AxiosResponse } from "axios";
// the kind of data I expect from the AJAX request...
interface AuthData {
access_token?: string;
refresh_token?: string;
}
// ... a type dedicated to the Axios response...
type AuthResponse = AxiosResponse<AuthData>;