thunky
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "thunky", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "delay the evaluation of a paramless async function and cache the result", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -79,4 +79,20 @@ # thunky | ||
## Promise version | ||
A promise version is available as well | ||
``` js | ||
var thunkyp = require('thunky/promise') | ||
var ready = thunkyp(async function () { | ||
// ... do async stuff | ||
return 42 | ||
}) | ||
// same semantics as the callback version | ||
await ready() | ||
``` | ||
## License | ||
MIT |
7758
7
162
98