Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/falci/simple-defer
https://github.com/falci/simple-defer
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/falci/simple-defer
- Owner: Falci
- License: mit
- Created: 2016-09-30T01:54:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-30T02:15:21.000Z (about 8 years ago)
- Last Synced: 2024-05-01T21:28:13.345Z (7 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```