coinconvert / crypto-convert

Instantly convert cryptocurrency and get price information
https://coinconvert.net
Other
81 stars 17 forks source link

Value returned when convert is false #1

Closed kevingamaa closed 3 years ago

kevingamaa commented 3 years ago

I'm working with node aplication and when i try to convert with the value that return is false, but when i set a timeout function the correct value is returned. Follow the example bellow: image image

Would you guys can add a promise or a resolution for that?

el1s7 commented 3 years ago

There is a few seconds delay only in the initial launch of the app until the local cache is created.

I can add a promise for that surely.

kevingamaa commented 3 years ago

A promise would be perfect because in a node aplication this would not cache the results in a native way from the API.

el1s7 commented 3 years ago

if(!convert.isReady){
    await convert.ready();
}
convert.BTC.USD(1);