Update promisify.md

This commit is contained in:
Angelos Chalaris
2020-01-13 10:06:24 +02:00
committed by GitHub
parent c8f50e6e44
commit 202ef9d260

View File

@ -1,6 +1,6 @@
---
title: promisify
tags: adapter,function,promise,intermediate
tags: function,promise,intermediate
---
Converts an asynchronous function to return a promise.
@ -20,4 +20,4 @@ const promisify = func => (...args) =>
```js
const delay = promisify((d, cb) => setTimeout(cb, d));
delay(2000).then(() => console.log('Hi!')); // // Promise resolves after 2s
```
```