Open jhliberty opened 8 years ago
Or better yet, use an es6 proxy could take care of that really easy.. Just trap out the construct and the apply calls.
On the constructor set the namespace just like you are doing now when you do new RedisNS('namespace', redisClient)
and for the apply calls just take the namespace, add it to the key and Reflect the call back to the redisclient with the new namespaced key and you're good to go. No worrying about their implementation logic really at all... and it would be a fair bit less trouble to update
Quite a few of the functions you define in index.js have the exact same signature except for a name property change... if you are manually writing these out consider refactoring to something like this function here. Reducing how many times you have to write things means less head to update without errors.