Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Functions

  • fetcher<T>(url: string, options?: RequestInit): Promise<T>
  • Simple and type-safe fetcher for Nextkit

    example
    import useSWR from "swr";
    import {fetcher} from "nextkit-fetcher";

    import type {NextPage} from "next";

    const Index: NextPage<Props> = (props) => {
    const { data } = useSWR("/api/user", fetcher);

    return <p>Hello {data.name}!</p>;
    };

    Type parameters

    • T

    Parameters

    • url: string
    • Optional options: RequestInit

    Returns Promise<T>

Generated using TypeDoc