Skip to content

Update getMetrics types#10

Open
MichaelDeBoey wants to merge 1 commit into
woubuc:masterfrom
MichaelDeBoey:update-getMetrics-types
Open

Update getMetrics types#10
MichaelDeBoey wants to merge 1 commit into
woubuc:masterfrom
MichaelDeBoey:update-getMetrics-types

Conversation

@MichaelDeBoey

Copy link
Copy Markdown
Contributor

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

@woubuc woubuc left a comment

Copy link
Copy Markdown
Owner

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.

Comment thread src/utils/url.ts
let url = endpoint
import { APIKey } from '../types';

export const formatUrl = (apiKey : APIKey, endpoint : string[], query : Record<string, any> = {}) : string => {

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread src/api/getMetrics.ts


export interface GetMetricsOptions {
export type GetMetricsOptions<Group extends MetricsGroup> = {

Copy link
Copy Markdown
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
Copy Markdown
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

@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.

2 participants