Get unlimited public & private packages + team-based management with npm Teams.Learn more »

simple-defer

0.0.2 • Public • Published

Simple Defer

A simple promise defer.

Usage

var Defer = require('simple-defer');

var deferred = new Defer();

deferred.promise.then(function(data) {
    document.body.innerHTML += '<p>Resolved: ' + data + '</p>';
});

document.body.innerHTML = '<p>Deferred created.</p>';

setTimeout(function() {
    deferred.resolve(123);
}, 2000);

Install

npm i simple-defer

DownloadsWeekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • avatar