Skip to content

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



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

@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