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

Refactor fetch calls #160

Open
ChristianMurphy opened this issue Nov 8, 2018 · 0 comments
Open

Refactor fetch calls #160

ChristianMurphy opened this issue Nov 8, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers semver patch a change that does not impact the API

Comments

@ChristianMurphy
Copy link
Member

There is an increasing pattern of duplication in our fetch calls.

const response = await fetch(
  contextApiUrl + process.env.VUE_APP_BROWSABLE_PORTLETS_URI,
  options
);

if (!response.ok) {
  throw new Error(response.statusText);
}

const {portlets} = await response.json();

This code may be simplified, and we can gain some new features, like timeout, using a wrapper library like ky.

@ChristianMurphy ChristianMurphy added enhancement New feature or request good first issue Good for newcomers semver patch a change that does not impact the API labels Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers semver patch a change that does not impact the API
Projects
None yet
Development

No branches or pull requests

1 participant