v4 changed the returned function to an arrow function from a regular one. I cannot come up with a good reason to do that, since it breaks promisifying prototypes. The prototype function cannot be bound beforehand and the arrow function forces lexical this (which is undefined). util.promisify was our workaround, since this case doesn't need the extra options of pify..
E.g. there is no way to promisify node-redis multi queries now:
// Async multi exec
redis.Multi.prototype.execAsync = pify(redis.Multi.prototype.exec);
const client = new redis.createClient(...);
// Use
const cmds = [...];
const res = await client.multi(cmds).execAsync();
// Boom: Cannot read property 'queue' of undefined
v4 changed the returned function to an arrow function from a regular one. I cannot come up with a good reason to do that, since it breaks promisifying prototypes. The prototype function cannot be bound beforehand and the arrow function forces lexical
this(which isundefined).util.promisifywas our workaround, since this case doesn't need the extra options ofpify..E.g. there is no way to promisify
node-redismulti queries now: