npm xior 0.3.8
v0.3.8

latest releases: 0.6.1, 0.6.0, 0.5.5...
6 months ago
  • feat(plugins): enhance plugins's enable* logic

Now you can return undefined in enable* method:

import xior from 'xior';
import errorRetryPlugin from 'xior/plugins/error-retry';

const http = xior.create();
http.plugins.use(
  errorRetryPlugin({
    enableRetry(config, error) {
      if (error.response?.status === 401) {
        return false;
      }
      // no return here, and will reuse the default `enableRetry` logic
    },
  })
);

Full Changelog: v0.3.7...v0.3.8

Don't miss a new xior release

NewReleases is sending notifications on new releases.