Introduce facade for sympto

This commit is contained in:
Julia Friesel
2018-07-03 09:42:26 +02:00
parent fb990b5a4b
commit e4bae38d13
4 changed files with 28 additions and 25 deletions
+7
View File
@@ -0,0 +1,7 @@
import getTemperatureStatus from './temperature'
import getMucusStatus from './mucus'
export default function (cycleDays) {
const temperatureStatus = getTemperatureStatus(cycleDays)
const mucusStatus = getMucusStatus(cycleDays)
}
+2 -6
View File
@@ -1,4 +1,4 @@
function detectTemperatureShift(temperaturesOfCycle) {
export default function getTemperatureStatus(temperaturesOfCycle) {
// sensiplan rounds temps to the nearest 0.05
const tempValues = temperaturesOfCycle.map(val => rounded(val, 0.05))
@@ -25,7 +25,7 @@ function detectTemperatureShift(temperaturesOfCycle) {
if (temp <= ltl) return acc
const checkResult = checkIfFirstHighMeasurement(temp, i, tempValues, ltl)
// if we don't have a winner, keep going
// if we don't have a winner, keep move on to the next candidates
if (!checkResult.isFirstHighMeasurement) return acc
// if we do, remember the details and start collecting the high level temps
@@ -115,8 +115,4 @@ function secondOrThirdTempIsAtOrBelowLtl(nextTemps, ltl) {
} else {
return false
}
}
export {
detectTemperatureShift
}