Sun calculation js library which is fully based on formula from http://aa.quae.nl/en/reken/zonpositie.html
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
465 B
24 lines
465 B
module.exports = Deferred
|
|
|
|
var P
|
|
/* istanbul ignore next */
|
|
try {
|
|
P = Promise
|
|
} catch (er) {
|
|
try {
|
|
P = require('bluebird')
|
|
} catch (er) {
|
|
throw new Error('this module requires a Promise implementation. ' +
|
|
'Try installing bluebird.')
|
|
}
|
|
}
|
|
|
|
|
|
function Deferred () {
|
|
this.resolve = null
|
|
this.reject = null
|
|
this.promise = new P(function (resolve, reject) {
|
|
this.reject = reject
|
|
this.resolve = resolve
|
|
}.bind(this))
|
|
}
|
|
|