Ditches the use of svelte-persisted-store for the balance state, so that we writes the wallet balance value to local storage only on Window's beforeunload event instead of writing on every value change.
Motivation
While I'm trying to debug performance issues, I noticed that every dropBall call has an updateStorage call to update the local storage. While this occupies a small amount of time, my computer has a fast SSD so writing to disk is fast. The same cannot be said for low-end devices where I/O time is slow.
Description
Ditches the use of svelte-persisted-store for the
balance
state, so that we writes the wallet balance value to local storage only on Window'sbeforeunload
event instead of writing on every value change.Motivation
While I'm trying to debug performance issues, I noticed that every
dropBall
call has anupdateStorage
call to update the local storage. While this occupies a small amount of time, my computer has a fast SSD so writing to disk is fast. The same cannot be said for low-end devices where I/O time is slow.