-
-
Notifications
You must be signed in to change notification settings - Fork 392
Release 5.0.0 #149
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
Release 5.0.0 #149
+17,479
−11,132
Conversation
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
…ge content kind; feat: request content type auto substitution
… response body type ('any' -> 'void')
This was
linked to
issues
Feb 12, 2021
Closed
Styn
reviewed
Feb 15, 2021
then<TResult1 = ResolveType, TResult2 = never>(onfulfilled?: ((value: ResolveType) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: RejectType) => TResult2 | PromiseLike<TResult2>) | undefined | null): TPromise<TResult1 | TResult2, RejectType>; | ||
catch<TResult = never>(onrejected?: ((reason: RejectType) => TResult | PromiseLike<TResult>) | undefined | null): TPromise<ResolveType | TResult, RejectType>; | ||
} | ||
<% } %> | ||
|
||
export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it hard to type responses in code that uses the HttpClient.
(For example when using this with the call
method of redux-saga
where you need to type the expected response yourself, since call
uses any
.
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.
Fixes:
i.e. if request body is form data, then request body content type will be
multipart/form-data
:paramName
path params (issue Critical bug with:paramName
path params #154)Features:
fetch
response"IMAGE"
content kind for response\request data objectsRequestParams
RequestHeaders
types for--route-types
(routeTypes: true
) option (issue Route parameter types #150, thanks @Fabiencdp )--default-response
option. Allows to set default type for empty response schema (default:void
) (based on issue Default response body type. #14)RequestParams
type now have thecancelToken
fieldHttpClient
instance now have theabortRequest(cancelToken)
methodBREAKING_CHANGES:
http-client.eta
template, make it more flexible and simpler.HttpClient["request"]
takes one argument with typeFullRequestParams
(previously it takes many count of arguments which was not flexible)
any
tovoid
(issue Default response body type. #14)Internal:
http-client.eta
procedure-call.eta
api.eta
This version works with previous templates.