ql

q-lazy

Q lazy promise resolution

Showing:

Popularity

Downloads/wk

0

GitHub Stars

1

Maintenance

Last Commit

8yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Q.lazy()

Promises/A+ logo

Resolves promises idly.

Build Status NPM version

npm install q-lazy

About

It's a simple plugin for Q allowing you to create lazy promises. Such promises start to resolve only after calling .then() on them.

Usage

var Q = require('q');
require('q-lazy'); // extends Q

function heavyFunc () {
    // ...
    return ret; // the return value can be a promise or a plain value
}

var promise = Q.lazy(heavyFunc); // doesn't execute heavyFunc

promise.then(function (ret) {    // executes heavyFunc
    // use ret
});

For specification take a look at provided testsuite. It's short.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial