Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/falci/simple-defer


https://github.com/falci/simple-defer

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# Simple Defer

A simple promise defer.

## Usage

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

var deferred = new Defer();

deferred.promise.then(function(data) {
document.body.innerHTML += '

Resolved: ' + data + '

';
});

document.body.innerHTML = '

Deferred created.

';

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