First, thanks for this great library.
I'm confused by how to gracefully persist data based on user account when using RN. We're developing an offline-support app, the user must log in before any other action. Persisting data by using a single key, or exactly, using configuration to set key/prefix-key is not sufficient. Once change user account, although this is rare, already persistent data would be a mess because these data do not belong to the new user. What was worse, the simply purge action is not acceptable, we should support the previous user accounts data rehydrate when they log in again.
Any recommendation?
Analogous to #637 and #320
@neutrous did you ever figure out a solution for this? I'm experience the same problem.
I've figured out how to dynamically set a different prefix-key, which is working great, but I need to rehydrate the data upon login/logout.
@twhitacre No... Finally, I've switched to use Realm. It works great.
@twhitacre how did you go about dynamically setting a different prefix-key?
@Faolain I ended up just setting a different prefix-key and reloading the app when the user changed. For me it's only on login and logout. It kicks the user to a loading screen while I wipe the persisted data from the store and then load it back in using the prefix of the user id (or guest).
That said, it works, but is not scaleable, especially if I end up with more than a few local users. I'm actually in the process of switching to Realm as well. It seems like the way to go for this type of application.
Hope that helps some!
@twhitacre No... Finally, I've switched to use Realm. It works great.
So now you are using Redux+Realm or Realm without Redux?
@twhitacre No... Finally, I've switched to use Realm. It works great.
So now you are using Redux+Realm or Realm without Redux?
I'm using Redux + Realm combo in production
Most helpful comment
@twhitacre No... Finally, I've switched to use Realm. It works great.