Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Caching not working #9

Closed
wheredoesyourmindgo opened this issue Oct 15, 2016 · 2 comments
Closed

Caching not working #9

wheredoesyourmindgo opened this issue Oct 15, 2016 · 2 comments

Comments

@wheredoesyourmindgo
Copy link

wheredoesyourmindgo commented Oct 15, 2016

Shouldn't Object.Assign be used to overwrite the default/static parameters with user supplied parameters?

I would think that the following...

this.options = Object.assign({}, options || {}, {
    service: 'darksky',
    units: 'celcius',
    cache: true,
    ttl: {
      minutes: 30
    }
  });

should be changed to this...

this.options = Object.assign({}, {
    service: 'darksky',
    units: 'celcius',
    cache: true,
    ttl: {
      minutes: 30
    }
  }, options || {} );
@jameswyse
Copy link
Owner

Good catch, I'll fix this now :)

Where did my mind go indeed.. I should really write some unit tests

@jameswyse
Copy link
Owner

Should be fixed in 0.3.1. Thanks!

@jameswyse jameswyse reopened this Oct 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants