facundoolano / redis-lru

Redis-backed LRU cache for Node.js
96 stars 13 forks source link

Set should return the Key instead of the value #15

Open roonie007 opened 5 years ago

roonie007 commented 5 years ago

I think its better that it returns the Key instead of the Value, because with the key, you can always do this to retrieve the value in a chaining promise

personCache.set('john', 'john, paul, george, ringo')
  .then(personCache.get)
  .then(console.log) // john, paul, george, ringo

but you have no way to get the Key from the chained Promise.

roonie007 commented 5 years ago

I opened PR #16