dabroek / node-cache-manager-ioredis

Redis store for node-cache-manager using IORedis.
MIT License
59 stars 29 forks source link

Add support for array of promises. #11

Closed Asafkbalink closed 4 years ago

Asafkbalink commented 4 years ago

When trying to cache an array of promises, the cached value is an array of empty objects. Adding this simple line adds support for that issue - if the supplied value is an array, then it sets the value to "await Promise.all()" of the value - this returns an array of values. The initial value can be anything else than a promise, and it won't break the logic.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.2%) to 93.043% when pulling 2c8c5f09da80d1e8838c8c86f8080224f66c611c on Asafkbalink:master into e091b671f265c8d0a64372f96126fd55a01c7037 on dabroek:master.