implemented onConfig to by pass the request if certain conditions are matched#120
Open
cyfung1031 wants to merge 2 commits intowendux:masterfrom
Open
implemented onConfig to by pass the request if certain conditions are matched#120cyfung1031 wants to merge 2 commits intowendux:masterfrom
onConfig to by pass the request if certain conditions are matched#120cyfung1031 wants to merge 2 commits intowendux:masterfrom
Conversation
8a8869f to
ba2271f
Compare
cyfung1031
added a commit
to cyfung1031/ajax-hook
that referenced
this pull request
Aug 16, 2023
cyfung1031
added a commit
to cyfung1031/ajax-hook
that referenced
this pull request
Aug 16, 2023
cyfung1031
added a commit
to cyfung1031/ajax-hook
that referenced
this pull request
Aug 16, 2023
cyfung1031
added a commit
to cyfung1031/ajax-hook
that referenced
this pull request
Aug 16, 2023
cyfung1031
added a commit
to cyfung1031/ajax-hook
that referenced
this pull request
Aug 16, 2023
Contributor
Author
|
Combined Distribution Script |
DAHUIAAAAA
reviewed
Sep 6, 2023
| if (onConfig) { | ||
| if (onConfig(config, this) === false) onRequest = null; | ||
| } | ||
| if (onRequest) return true; |
Collaborator
| } | ||
|
|
||
| interface Proxy { | ||
| onConfig?: (config: XhrRequestConfig, xhrProxy: Hooks) => boolean | void, |
Collaborator
There was a problem hiding this comment.
改成 onFilter 吧,语义化更好,第二个参数没什么太大用处,可以不传,因为过滤 url 后就可以直接走原生方法了,不用手动调用,切莫过度设计
Collaborator
|
新增 api 需要完善一下 markdown 文档 |
Contributor
Author
新增了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

close #118
Remarks
Since most requests are
async, it might not be suitable to do the bypassing inonRequest.onConfigis synchronously triggered inxhr.open, so it can completely bypass the entireopen+setRequestHeader(POST request)+send.Usage