Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

less prescriptive api call#9

Open
BenfcAC wants to merge 1 commit intomasterfrom
feature/simplify-fetch
Open

less prescriptive api call#9
BenfcAC wants to merge 1 commit intomasterfrom
feature/simplify-fetch

Conversation

@BenfcAC
Copy link
Copy Markdown

@BenfcAC BenfcAC commented Apr 11, 2022

Create less prescriptive version of the api call

Comment on lines +18 to +21
fetch(url, { headers: { "x-api-version": "2" } })
.then(res => res.json())
.then(json => setData(json))
.catch(err => setError(err))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added useSWR to help with the slow API but I do like the simplicity of this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants