mirror of
https://github.com/acamarata/solar-spa.git
synced 2026-07-03 04:10: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",
|
"name": "solar-spa",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "NREL Solar Position Algorithm (SPA) in WebAssembly",
|
"description": "NREL Solar Position Algorithm (SPA) in WebAssembly",
|
||||||
"main": "solar-spa.js",
|
"main": "solar-spa.js",
|
||||||
"types": "index.d.ts",
|
"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(
|
module.exports = function spa(
|
||||||
date,
|
date,
|
||||||
|
|
@ -9,9 +10,8 @@ module.exports = function spa(
|
||||||
pressure = 1013.25,
|
pressure = 1013.25,
|
||||||
refraction = 0.5667
|
refraction = 0.5667
|
||||||
) {
|
) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
const spaModule = spaModuleFactory({
|
spaModule.onRuntimeInitialized = function () {
|
||||||
onRuntimeInitialized: () => {
|
|
||||||
const spa_calculate = spaModule.cwrap(
|
const spa_calculate = spaModule.cwrap(
|
||||||
'spa_calculate_wrapper',
|
'spa_calculate_wrapper',
|
||||||
'number',
|
'number',
|
||||||
|
|
@ -57,10 +57,6 @@ module.exports = function spa(
|
||||||
spa_free_result(resultPtr);
|
spa_free_result(resultPtr);
|
||||||
|
|
||||||
resolve(result);
|
resolve(result);
|
||||||
},
|
};
|
||||||
});
|
|
||||||
if (spaModule.calledRun) {
|
|
||||||
spaModule.onRuntimeInitialized();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue