nordnet / nordnet-next-api

Nordnet nExt API Javascript client
27 stars 11 forks source link

Fixed spelling in README & support for setting root url before callin… #2

Closed hassellof closed 8 years ago

hassellof commented 8 years ago

Support for setting root url before calling API using setConfig({root: 'http://something'})

Fixed spelling in README and included instructions for how to use setConfig

iamstarkov commented 8 years ago

looks good to me

dimchez commented 8 years ago

@hassellof could you, please, add tests for

hassellof commented 8 years ago

@dimchez I was planning to take a look at your tests and to expand the test coverage a bit tomorrow. Just quickly getting acquainted with the code today.

Regarding typeof, it's just good practice when checking if a value is defined or not since there are many values that returns false in an if statement, like 0.

Double exclamation marks should always be avoided though, since it makes the code much more difficult to understand at a first glance. Just like double negation in spoken language makes things more difficult, especially for non-native speakers.

In this context it really makes no practical difference, typeof just makes it more readable imho. If you want an shorter alternative to "typeof undefined" then just if(config.root) should work well, since 0 et.al. is not a valid value for root URL any way.

dimchez commented 8 years ago

@hassellof ok, typeof it is then :+1:

iamstarkov commented 8 years ago

oh, forgotten pr