Fork me on GitHub
#cljsrn
<
2017-05-08
>
kurt-o-sys13:05:58

I'm checking https://facebook.github.io/react-native/docs/asyncstorage.html to store some app state... I can't seem to figure out how to use AsyncStorage.

kurt-o-sys13:05:24

How to store app state in cljsrn? (doesn't need to be AsyncStorage)

pesterhazy17:05:53

store durably or in memory?

kurt-o-sys17:05:31

durably. In memory is pretty easy, that's just an atom (or a few atoms) with the app state.

kurt-o-sys17:05:28

The problem is, the atom state is not kept between closing/opening the app (it is not a problem when it's switching between active/inactive).

misha18:05:27

@kurt-o-sys are you sure you are not re-building/re-deploying app, instead of closing/reopening in it simulator?

vikeri18:05:35

@kurt-o-sys I recommend using Realm. Way faster than AsyncStorage, almost as simple API and offers goodies like encryption and indexing.

kurt-o-sys22:05:38

@misha I'm running it on a real device. I close and start it again. Not sure what exactly happens when running react-native and figwheel. I only do know that app state is not stored...

kurt-o-sys22:05:35

@vikeri OK, will try. Thanks a lot.