Module Note_brr_legacy.StoreSource
Persistent storage.
Persisent key-value store implemented over webstorage. Safe if no one tampers with the storage outside of the program.
XXX.
- This still relies on the jsoo representation, add safer keys with type indexed codecs.
- Provide something sensitive for storage events
Storage scope
The storage scope.
Keys
The type for keys whose lookup value is 'a
key ~ns () is a new storage key in namespace ns. If ns is unspecified, the key lives in a global namespace.
Warning. Reordering invocations of key in the same namespace will most of the time corrupt existing storage. This means that all key calls should always be performed at initialization time. Store.force_version can be used to easily version your store and aleviate this problem.
Storage
In the functions below scope defaults to `Persist.
get k is k's mapping. If absent is provided and m has not binding for k, absent is returned.
ev fires on storage changes. FIXME provide something sensitive, e.g. key watching.