potato-promise
Super tiny, dependency-free wrapper to make promises lazy, i.e. sit there like a potato until .then()
is invoked.
Assumes native promises, or at least Promise
on the global scope (global
or window
).
Installation
$ npm i -S potato-promise
Usage
const Potato = const p = { console } console // > 1// ...after 1 second...// > 2// > 3
Note: I'm only using new
here for familiar semantics; this is actually
a factory function. The following would also work...
Promiselazy = const p = Promise