Use the same options object in handle-response as in send-request (#148)

Instead of cloning this.options again in handle-response.js, pass the options object from send-request.js. This way, pjax.state.options will also have the request options.
This commit was merged in pull request #148.
This commit is contained in:
BehindTheMath
2018-04-26 09:27:50 -04:00
committed by GitHub
parent 358b6f6836
commit 7d26a75fdf
5 changed files with 20 additions and 14 deletions

3
index.d.ts vendored
View File

@@ -67,8 +67,9 @@ declare class Pjax {
* @param {string} requestText The raw text of the response. Same as <code>request.responseText</code>.
* @param {XMLHttpRequest} request The XHR object.
* @param {string} href The original URI used to initiate the request.
* @param options The Pjax options object used for the request
*/
handleResponse(requestText: string, request: XMLHttpRequest, href: string): void;
handleResponse(requestText: string, request: XMLHttpRequest, href: string, options?: Pjax.IOptions): void;
/**
* Initiates the request by calling <code>doRequest()</code>.