0.1.0 • Published 10 months ago

@doner/fetch v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Build

import { createFetchService } from "@doner/fetch";

const fetchService = createFetchService({
  handleRequest: window.fetch.bind(window),
  rootURL: "/api",
});
const ac = new AbortController();
const searchParams = new URLSearchParams();

searchParams.append("page", "1");
searchParams.append("pageSize", "25");

fetchService.get("/todos");
fetchService.get("/todos", { signal: ac.signal });
fetchService.get("/todos", { signal: ac.signal }, searchParams);