mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-01-15 22:28:41 +00:00
avoid performing a get on unit stores for each point
This commit is contained in:
@@ -229,6 +229,9 @@ export function getConvertedVelocity(
|
||||
}
|
||||
}
|
||||
|
||||
export function getConvertedTemperature(value: number) {
|
||||
return get(temperatureUnits) === 'celsius' ? value : celsiusToFahrenheit(value);
|
||||
export function getConvertedTemperature(
|
||||
value: number,
|
||||
targetTemperatureUnits = get(temperatureUnits)
|
||||
) {
|
||||
return targetTemperatureUnits === 'celsius' ? value : celsiusToFahrenheit(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user