- 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