Skip to content
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

fix(types): update generics in request #2

Merged
merged 2 commits into from
Jan 9, 2019

Conversation

jcreamer898
Copy link

No description provided.

src/request.ts Outdated
@@ -145,7 +147,10 @@ const _catchStatusError = (res: Response): Promise<any> =>
* Low-level method that makes fetch requests, returning the response formatted as JSON.
* It parses errors from API v3 and throws exceptions with those errors
*/
const jsonRequest = <T>(url: string, options?: RequestInit) =>
_fetchJSON<T>(url, options).catch(_catchStatusError);
const jsonRequest = <TResponseType = any>(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this any be {} since we always expect an object.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because of this...

@kwelch kwelch merged commit 2cb171e into kwelch:add-users-api Jan 9, 2019
@jcreamer898 jcreamer898 deleted the jc-add-users branch January 9, 2019 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants