mirror of
https://github.com/acamarata/solar-spa.git
synced 2026-07-04 12:50:41 +00:00
Revert bug fix in 1.2.1
This commit is contained in:
parent
e0faeadcde
commit
a4b07f8cee
2 changed files with 45 additions and 49 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "solar-spa",
|
||||
"version": "1.2.3",
|
||||
"version": "1.2.4",
|
||||
"description": "NREL Solar Position Algorithm (SPA) in WebAssembly",
|
||||
"main": "solar-spa.js",
|
||||
"types": "index.d.ts",
|
||||
|
|
|
|||
14
solar-spa.js
14
solar-spa.js
|
|
@ -1,4 +1,5 @@
|
|||
const spaModuleFactory = require('./spa.js');
|
||||
// solar-spa.js
|
||||
const spaModule = require('./spa.js');
|
||||
|
||||
module.exports = function spa(
|
||||
date,
|
||||
|
|
@ -9,9 +10,8 @@ module.exports = function spa(
|
|||
pressure = 1013.25,
|
||||
refraction = 0.5667
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const spaModule = spaModuleFactory({
|
||||
onRuntimeInitialized: () => {
|
||||
return new Promise((resolve) => {
|
||||
spaModule.onRuntimeInitialized = function () {
|
||||
const spa_calculate = spaModule.cwrap(
|
||||
'spa_calculate_wrapper',
|
||||
'number',
|
||||
|
|
@ -57,10 +57,6 @@ module.exports = function spa(
|
|||
spa_free_result(resultPtr);
|
||||
|
||||
resolve(result);
|
||||
},
|
||||
});
|
||||
if (spaModule.calledRun) {
|
||||
spaModule.onRuntimeInitialized();
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue