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

Pass args in when you call the function not when you define it #60

Open
joeylouise opened this issue Jul 28, 2017 · 0 comments
Open

Pass args in when you call the function not when you define it #60

joeylouise opened this issue Jul 28, 2017 · 0 comments

Comments

@joeylouise
Copy link

In apiRequest.js, you pass your url and apiKey into buildAPIURL function when you define the function. I'd pass these in when you call the function, so that you keep buildAPIURL generic

e.g.

const buildAPIURL = ( date, apiURL, apiKey ) => {
  return `${apiURL}?api-key=${apiKey}&begin_date=${date}&end_date=${date}&sort=newest`;
}
@joeylouise joeylouise changed the title Pass args in when you call the function Pass args in when you call the function not when you define it Jul 28, 2017
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

No branches or pull requests

1 participant