jmtellez / CLI-mate

Node CLI app that gives you the weather forecast for a given city.
6 stars 10 forks source link

setTimeout() wraps all network calls? #24

Closed r-i-c-h closed 3 years ago

r-i-c-h commented 3 years ago

Why do all of the network calls happen after a 1second setTimeout()?

If it's a question of the state of the request connection, according to the documentation on https://github.com/postmanlabs/postman-request#requestoptions-callback - request's options object takes a timeout: value which should cover this.

Otherwise, I'd suggest perhaps working with returning a Promise or an Async/Await style for http requests?

jmtellez commented 3 years ago

setTimeout() is there to allow the user to see the ora spinner, feel free to work on change and open a PR