How to use the ky-universal.extend function in ky-universal

To help you get started, we’ve selected a few ky-universal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyanmandian / react-etalpreliob / src / utils / request / index.ts View on Github external
import ky from "ky-universal";

export const request = ky.extend({
  prefixUrl: "https://api-example.com",
  retry: 3,
  hooks: {
    beforeRequest: [request => request],
    afterResponse: [(_, __, response) => response]
  }
});