Skip to content

Commit

Permalink
chore: added probed location feature into time series function
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed Aug 28, 2024
1 parent 38bd985 commit 1db721a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion map/client/utils/utils.time-series.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function getTimeSeries({
// Known by the unit system ?
const unit = Units.getUnit(baseUnit) || { name: baseUnit }
const serie = {
probedLocation: data,
data: getDataForVariable(data, variable, forecastLevel),
variable: {
name: variable.name,
Expand All @@ -97,7 +98,10 @@ export function getTimeSeries({
}
}
// FIXME: how to share promise between series ?
serie.fetch = () => { serie.data = getDataForVariable(fetch(), variable, forecastLevel) }
serie.fetch = () => {
serie.probedLocation = fetch()
serie.data = getDataForVariable(serie.probedLocation, variable, forecastLevel)
}
return serie
})

Expand Down

0 comments on commit 1db721a

Please sign in to comment.