Skip to content

Commit b84a74c

Browse files
committed
fix JS docs
1 parent e15541f commit b84a74c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ For JavaScript, we provide an ESM module with TypeScript typings and a
8080
import { PokeApi } from "@pokeapi/pokekotlin";
8181

8282
const list = await PokeApi.Default.getPokemonSpeciesListAsync(0, 10);
83-
for (const handle of list.results) {
84-
const species = await PokeApi.Default.getAsync(handle);
85-
console.log(`Found: ${species}`);
83+
for (const handle of list.asJsReadonlyArrayView().results) {
84+
const species = await PokeApi.Default.getPokemonSpeciesAsync(handle.id);
85+
console.log(`Found: ${species.toString()}`);
8686
}
8787
```
8888

docs/docs/usage-js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ try {
5555
// Get a list of Pokémon species
5656
const list = await PokeApi.Default.getPokemonSpeciesListAsync(0, 10);
5757

58-
for (const handle of list.results) {
58+
for (const handle of list.asJsReadonlyArrayView().results) {
5959
// Get each species by its handle
60-
const species = await PokeApi.Default.getAsync(handle);
61-
console.log(`Found: ${species}`);
60+
const species = await PokeApi.Default.getPokemonSpeciesAsync(handle.id);
61+
console.log(`Found: ${species.toString()}`);
6262
}
6363
} catch (error) {
6464
console.error(`Error: ${error.message}`);

0 commit comments

Comments
 (0)