You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collect obsolete persistence as soon as possible, which is currently impossible because accessing a persisted record can only be done with the relative atom.
Initialize asynchronous storage (IndexedDB) at application startup.
Main idea:
Persisted Atoms Registry
It would be nice to have a separate registry with metadata about persisted atoms, so that we can manage them based on their lifetime (delete if it has expired).
This would be an atom with a PersistRecord array that would also be persisted.
We will have some init method (or maybe just on app init) that does the following:
Loads the registry into memory from the persistence layer
Checks all the entries in the registry:
if the entry has expired - it should be deleted (gargabe collector).
if the entry has not expired - it should be loaded into the memory cache.
We can store the loaded status for each individual persisted atom, or maybe for the whole registry, this is negotiable.
As a result, we can do something like this when initializing the application.
We want to:
Main idea:
Persisted Atoms Registry
PersistRecord
array that would also be persisted.init
method (or maybe just on app init) that does the following:loaded
status for each individual persisted atom, or maybe for the whole registry, this is negotiable.As a result, we can do something like this when initializing the application.
This way, persisted atoms are guaranteed to be initialized during rendering.
The text was updated successfully, but these errors were encountered: