iWeltAG / pinia-cached-store

Pinia store extension that allows transparent caching of state in local storage.
https://www.npmjs.com/package/pinia-cached-store
MIT License
21 stars 0 forks source link

Support arbitrary payloads for loading #5

Closed yrd closed 2 years ago

yrd commented 2 years ago

Currently the entire input object for $load (and therefore refresh) is used to create a caching key. To support workloads that store arbitrary data, we should provide a second argument that can be used for different purposes.

As an alternative, we could also start supporting arbitrary writes on the store and provide a $writeCache function to update localstorage (or even do that automatically).