Is it possible in Javascript to wait for animation when retrieving from localStorage?

Realizing that the Javascript localStorage API is synchronous and thus blocks, is there any workaround that allows me to display pending animations that don't freeze during getItem() or setItem() operations?

+3
javascript local-storage
Jun 27 '13 at 17:26
source share
2 answers

If getting 300kB of data from local storage and parsing it using JSON.parse too slow for one synchronous lock operation, you will have to split it into smaller pieces. They can be stored in separate storage slots and the shell can be processed in an asynchronous cycle (see Also JavaScript Performance Long Running Work Tasks , How to stop an intensive Javascript cycle from freezing the browser ).

+3
Jun 27 '13 at 18:21
source share

You can perform any synchronous operation, including localStorage, asynchronously using Web Workers .

+1
Jun 27 '13 at 17:32
source share



All Articles