pinqy520 / mobx-persist

persist mobx stores
MIT License
560 stars 62 forks source link

Can we have an expiration time for the persistance? #85

Open BadMask121 opened 4 years ago

renepardon commented 4 years ago

You could simply add a new property to your store with a timestamp (and persist it as well) and during hydrate call you check against the current timestamp. If an expiration time frame is reached, you just don't hydrate the data back to the store (and probably also delete it from persistent place as well)