-
Notifications
You must be signed in to change notification settings - Fork 5
Update getMetrics types #10
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
base: master
Are you sure you want to change the base?
Conversation
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.
Apologies for the wait, this have been a little hectic these days. Your changes look great! Just two small syntax details where I'm not sure why you changed them, see my comments.
let url = endpoint | ||
import { APIKey } from '../types'; | ||
|
||
export const formatUrl = (apiKey : APIKey, endpoint : string[], query : Record<string, any> = {}) : string => { |
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.
Is there a particular reason you made this an arrow function? If not, I think it would be clearer if you change this back to a regular function notation.
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.
All other functions I've changed are arrow functions, so this would make it consistent
import { formatUrl } from '../utils/url'; | ||
import { handleResponse } from '../utils/handleResponse'; | ||
|
||
|
||
export interface GetMetricsOptions { | ||
export type GetMetricsOptions<Group extends MetricsGroup> = { |
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 is an object notation, so why should this be a type
rather than an interface
?
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.
I think using a consistent use of type
(see other types) would be better
4733667
to
5db6348
Compare
As discussed in #9 (comment), I've updated the types of
getMetrics