App: Persist State
Feature Description
Persist state in order to save salt and score for the reveal
(might want to persist other stores such as assessments)
Motivation and Context
@jaredpereira about !140 (merged) :
I think persisting this to local storage is important for this MR. There are two ways we could do this:
- In this component loading and persisting from localStorage
- In the redux setup with redux-persist
The latter is more comprehensive (as we later will probably want to persist more as to avoid extra calls to chain), but the latter would be way simpler here.
This issue is related to #174 (closed) , as
-
we need persisting state because we need to refresh app after commiting score
-
we might want to add timestamp to assessments, because if we decide to persist them into state, we need to update them if they're outdated
and to #197 (closed) , as we can't currently commit anything else than 100 score, because any other score would be overwritten by refresh (to update assessment data)
Possible Implementation
either https://github.com/rt2zz/redux-persist
OR use localStorage.setItem/getItem
OR use a decentralized storing system, such as the IPFS chrome extension (PRO: totally decentralized and cache-free, CONS: requires to use IPFS extension)