Rerender chart on scale observable change

This commit is contained in:
Julia Friesel
2018-08-22 10:17:32 +02:00
parent c597a654d8
commit 7538dbdccc
5 changed files with 16 additions and 15 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import { AsyncStorage } from 'react-native'
import Observable from 'obv'
import config from '../config'
export const tempScaleObservable = Observable()
export const scaleObservable = Observable()
setTempScaleInitially()
async function setTempScaleInitially() {
@@ -16,11 +16,11 @@ async function setTempScaleInitially() {
max: config.temperatureScale.defaultHigh
}
}
tempScaleObservable.set(value)
scaleObservable.set(value)
}
export async function saveTempScale(scale) {
await AsyncStorage.setItem('tempScale', JSON.stringify(scale))
tempScaleObservable.set(scale)
scaleObservable.set(scale)
}