@axios-use/plugins
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha.0 • Public • Published

@axios-use/plugins

Plugins for Axios

Interceptors

Retry

A Axios interceptor to retry requests. Intercept AxiosError code ERR_NETWORK and ETIMEDOUT report errors, try to retry again.

import { retryInterceptorArgs } from "@axios-use/plugins";
// or
import retryInterceptorArgs from "@axios-use/plugins/retry";

axios.interceptors.response.use(...retryInterceptorArgs);
config type default explain
retry number - number of retries
retryDelay number 1000 millisecond of retry delay
axios({
  method: "get",
  url: "/api/users",
  /** number of retries */
  retry: 1,
  /** millisecond of retry delay @default 1000 */
  retryDelay: 1200,
});

License

MIT

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @axios-use/plugins

    Weekly Downloads

    1

    Version

    0.1.0-alpha.0

    License

    MIT

    Unpacked Size

    7.26 kB

    Total Files

    11

    Last publish

    Collaborators

    • wangcch