Newer
Older
import { AsyncStorage } from 'react-native'
export const scaleObservable = Observable()
async function setTempScaleInitially() {
const result = await AsyncStorage.getItem('tempScale')
let value
if (result) {
value = JSON.parse(result)
} else {
value = {
min: config.temperatureScale.defaultLow,
max: config.temperatureScale.defaultHigh
}
}
}
export async function saveTempScale(scale) {
await AsyncStorage.setItem('tempScale', JSON.stringify(scale))