Skip to content
This repository has been archived by the owner. It is now read-only.
LazyPromise for node.js
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.eslintrc.json Added rule for object shorthand. Mar 5, 2016
.gitignore
.travis.yml Updated CI config. Feb 23, 2016
LICENSE
README.md
build.js
index.es6.js
index.js Added rule for object shorthand. Mar 5, 2016
package.json

README.md

LazyPromise Build Status Code Climate

What is it?

It's a subclass of native ES6 Promise object, which evaluates only when then is called. It's written primarily for node.js, but should also run in browser.

Usage

const LazyPromise = require('lazy-promise');

let promise = new LazyPromise(function(resolve, reject)
{
	resolve('ok');
});

promise.then(function(answer)
{
	console.log('Everything is ' + answer);
});
You can’t perform that action at this time.