Chok’s React Utilities
    Preparing search index...

    Module fetcher

    An alternate syntax to fetch() that allows function chaining to compose the entire fetch request. One can also compose partial fetcher objects to be reused in future requests.

    Examples:

      const userFetcher = fetcher
    .auth("Bearer TOPSECRET")
    .content("application/json")
    .url("/api/user");

    const user = await userFetcher.get();

    const updateResult = await userFetcher
    .body({ id: user.id, name: "New name"})
    .post();

    Variables

    fetcher
    simpleFetcher