We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6dfd7cd + be04e78 commit 24e45a6Copy full SHA for 24e45a6
pokemon-client.js
@@ -2,9 +2,9 @@ import fetch from 'node-fetch';
2
3
const BASE_API = 'http://pokeapi.co';
4
5
-export function pokemon({id = 1} = {}){
6
- return fetch(`${BASE_API}/api/v1/pokemon/${id}`)
7
- .then((response) => response.json());
+export async function pokemon({id = 1} = {}){
+ var response = await fetch(`${BASE_API}/api/v1/pokemon/${id}`);
+ return response.json();
8
};
9
10
export async function descriptions({pokemon = false} = {}){
0 commit comments