-
-
Notifications
You must be signed in to change notification settings - Fork 714
feat: add new dispatch compose #2826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
560d35b
feat: add new dispatch compose
metcoder95 5337ea0
fix: review
metcoder95 8019e59
revert: linting
metcoder95 1d54170
docs: add documentation
metcoder95 051caa1
Merge remote-tracking branch 'origin/main' into feat/compose-dispatch
metcoder95 b45ecad
fix: smaller tweaks to proxy interceptor
metcoder95 9048eb5
test: fix tests for proxy
metcoder95 7656e1b
refactor: expose interceptor as is
metcoder95 9f0631e
Merge branch 'main' into feat/compose-dispatch
metcoder95 5588a1d
test: add testing for retry
metcoder95 04c8acb
refactor: rewrite interceptors
metcoder95 8ac252d
refactor: proxy interceptor
metcoder95 8c8c064
feat: redirect interceptor
metcoder95 9d1a6c0
Merge branch 'main' into feat/compose-dispatch
metcoder95 0fd9ea7
refactor: change the compose behaviour
metcoder95 53f4cfa
docs: update docs
metcoder95 6580d84
test: add testing for compose
metcoder95 1d987a2
Merge branch 'main' into feat/compose-dispatch
metcoder95 d66530f
feat: composed dispatcher
metcoder95 b932ad2
docs: adjust documentation
metcoder95 20d3a33
refactor: apply review
metcoder95 2d59acc
Merge branch 'main' into feat/compose-dispatch
metcoder95 2f5982e
docs: tweaks
metcoder95 eb065f7
Merge branch 'main' into feat/compose-dispatch
metcoder95 620f9bc
feat: drop proxy
metcoder95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 'use strict' | ||
| const RedirectHandler = require('../handler/redirect-handler') | ||
|
|
||
| module.exports = opts => { | ||
| const globalMaxRedirections = opts?.maxRedirections | ||
| return dispatch => { | ||
| return function redirectInterceptor (opts, handler) { | ||
ronag marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts | ||
|
|
||
| if (!maxRedirections) { | ||
| return dispatch(opts, handler) | ||
| } | ||
|
|
||
| const redirectHandler = new RedirectHandler( | ||
| dispatch, | ||
| maxRedirections, | ||
| opts, | ||
| handler | ||
| ) | ||
|
|
||
| return dispatch(baseOpts, redirectHandler) | ||
| } | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 'use strict' | ||
| const RetryHandler = require('../handler/retry-handler') | ||
|
|
||
| module.exports = globalOpts => { | ||
| return dispatch => { | ||
| return function retryInterceptor (opts, handler) { | ||
| return dispatch( | ||
| opts, | ||
| new RetryHandler( | ||
| { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } }, | ||
| { | ||
| handler, | ||
| dispatch | ||
| } | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.