Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaelDeBoey
Copy link
Contributor

As discussed in #9 (comment), I've updated the types of getMetrics

Copy link
Owner

@woubuc woubuc left a 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 => {
Copy link
Owner

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.

Copy link
Contributor Author

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> = {
Copy link
Owner

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?

Copy link
Contributor Author

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

Verified

This commit was signed with the committer’s verified signature.
benashz Ben Ash
@MichaelDeBoey MichaelDeBoey force-pushed the update-getMetrics-types branch from 4733667 to 5db6348 Compare April 23, 2020 11:19
@MichaelDeBoey MichaelDeBoey requested a review from woubuc April 23, 2020 11: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.

None yet

2 participants