lotus / inc /asyncCall.ts
k-l-lambda's picture
commit lotus dist.
d605f27
raw
history blame
198 Bytes
const asyncCall = (func, ...args): Promise<any> => new Promise((resolve, reject) => func(...args, (err, data) => {
if (err)
reject(err);
else
resolve(data);
}));
export default asyncCall;