diff --git a/docs/change-log.md b/docs/change-log.md index cf274a09..a4fb7986 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -20,7 +20,7 @@ ### Breaking changes: -- Due to the poor level of compatibility between XDomainRequest and XHR2, XDomainRequest is no longer called internally by Mithril. If you need to use CORS in IE9 or lower, you will need to return an XDomainRequest instance from `m.request`'s `config` method. +- Due to the poor level of compatibility between XDomainRequest and XHR2, XDomainRequest is no longer called internally by Mithril. If you need to use CORS in IE9 or lower, you will need to return an XDomainRequest instance from `m.request`'s `config` method [#121](https://github.com/lhorie/mithril.js/issues/121) --- diff --git a/docs/mithril.request.md b/docs/mithril.request.md index 0b75068c..10230361 100644 --- a/docs/mithril.request.md +++ b/docs/mithril.request.md @@ -314,7 +314,7 @@ where: [any deserialize(String dataToDeserialize),] [any extract(XMLHttpRequest xhr, XHROptions options),] [void type(Object data),] - [void config(XMLHttpRequest xhr, XHROptions options)] + [XMLHttpRequest? config(XMLHttpRequest xhr, XHROptions options)] } ``` @@ -435,7 +435,7 @@ where: And the data is `[{name: "John"}, {name: "Mary"}]`, then the response will contain an array of two User instances. - - **void config(XMLHttpRequest xhr, XHROptions options)** (optional) + - **XMLHttpRequest? config(XMLHttpRequest xhr, XHROptions options)** (optional) An initialization function that runs after `open` and before `send`. Useful for adding request headers and when using XHR2 features, such as the XMLHttpRequest's `upload` property. @@ -446,6 +446,10 @@ where: - **XHROptions options** The `options` parameter that was passed into `m.request` call + + - **returns XMLHttpRequest? xhr** + + You may return an XHR-like object (e.g. a XDomainRequest instance) to override the provided XHR instance altogether. - **returns Promise promise**