bee-dashboard icon indicating copy to clipboard operation
bee-dashboard copied to clipboard

Optimise local storage usage to avoid deserialisation all the time

Open Cafe137 opened this issue 4 years ago • 1 comments

I'd suggest to just always serialize the history you have live in app and overwrite the localstorage history key. I don't see a reason why this should always try retrieve the full history, deserialize it, find a record that may need to be replaced, serialize it and save it.

Originally posted by @vojtechsimetka in https://github.com/ethersphere/bee-dashboard/pull/260#discussion_r763674310

Cafe137 avatar Dec 07 '21 13:12 Cafe137

Originally it was done on purpose since the local storage operations are often called without having the state in a deserialised object form, but maybe having it extracted to a provider is a better way to approach this.

Cafe137 avatar Dec 07 '21 13:12 Cafe137