Open robert-westenberger opened 1 month ago
1.20.0
20.16.0
macOs
This isn't really a bug, more of a question. Why mix await and .then? Seems like an oversight.
Just use await, theres no reason to mix await and .then
Look at the documentation here https://pokenode-ts.vercel.app/guides/getting-started#basic-example
import { PokemonClient } from 'pokenode-ts'; (async () => { const api = new PokemonClient(); await api .getPokemonByName('luxray') .then((data) => console.log(data.name)) // will output "Luxray" .catch((error) => console.error(error)); })();
import { MainClient } from 'pokenode-ts'; (async () => { const api = new MainClient(); await api.pokemon .getPokemonByName('luxray') .then((data) => console.log(data.name)) // will output "Luxray" .catch((error) => console.error(error)); })();
Version of Pokenode-ts
1.20.0
Node.js Version
20.16.0
Operating System
macOs
Bug Description
This isn't really a bug, more of a question. Why mix await and .then? Seems like an oversight.
Expected Behavior
Just use await, theres no reason to mix await and .then
Steps to Reproduce
Look at the documentation here https://pokenode-ts.vercel.app/guides/getting-started#basic-example