Comandeer / LazyPromise

LazyPromise for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);
});

About

LazyPromise for node.js

License:MIT License


Languages

Language:JavaScript 100.0%