jpodwys / cache-service

A tiered caching solution for JavaScript.
MIT License
12 stars 6 forks source link

Ambiguity on docs for .set() #15

Closed thanpolas closed 8 years ago

thanpolas commented 8 years ago

As per the docs:

.set(key, value, [expiraiton], [refresh(key, cb)], [callback])

expiration and refresh are optional, so effectively one could write:

cs.set('key', 'value', function(err, res) {});

However that is not the case as the callback will never be invoked.

jpodwys commented 8 years ago

This is a problem with the code not the documentation. It appears that I'm not assigning the callback when only 3 arguments are passed.

jpodwys commented 8 years ago

It seems I spoke too soon. Because both are functions and both accept they same number of arguments, I can't determine which is which. I'll updates the docs.

jpodwys commented 8 years ago

I created a branch to try to fix the issue you listed above both by adjusting the code and by adding documentation. Please have a look at the diff and let me know what you think.

thanpolas commented 8 years ago

yup, that's what should be done for this case... Let's continue this discussion on jpodwys/cache-service#19

jpodwys commented 8 years ago

.set() fixed and readme updated in 1.3.6.