From f7310ca083afe7270d6fbf16ec33fc977573a684 Mon Sep 17 00:00:00 2001 From: MiguelMadero Date: Wed, 14 Feb 2018 17:49:39 -0800 Subject: [PATCH] Documents the timeout default --- README.md | 2 +- lib/defaults.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75b899e..5eabb95 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,7 @@ instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; ### Config order of precedence -Config will be merged with an order of precedence. The order is library defaults found in `lib/defaults.js`, then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. ```js // Create an instance using the config defaults provided by the library diff --git a/lib/defaults.js b/lib/defaults.js index 9587b28..65a25d5 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -63,6 +63,10 @@ var defaults = { return data; }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN',