diff --git a/src/counter.js b/src/counter.js index 85da815..344c802 100644 --- a/src/counter.js +++ b/src/counter.js @@ -22,6 +22,7 @@ class Counter { async list () { let keys = await this.redis.keys('*') + if (keys.length == 0) { return {} } let vals = await this.redis.mget(keys) /* combine list of keys and values into an object */ return keys.reduce((obj, k, i) => ({...obj, [k]: vals[i] }), {})