mobx-persist
mobx-persist copied to clipboard
Rehydrating a Map with integers as keys turns them into strings.
I can imagine this has to do with using react natives AsyncStorage, which only saves strings.
We should find a way to save the type of the key before saving them to async storage. Once saved there I think it is not possible to find out the type again.
Maybe this is an issue with all integers?
Easily reproducible by creating a @persist Map<number, whatever>
, then saving something in it, rehydrating, and its key has changed from int to string.
I have a similar issue:
@observable public Categories: Map<string, boolean>;
which is a <ObservableMap> becomes a <Proxy> and don't have the value after hydrating..