beekai-oss / little-state-machine

📠 React custom hook for persist state management
https://lrz5wloklm.csb.app/
MIT License
1.48k stars 53 forks source link

Catching Storage error #132

Closed jdozierezell closed 2 years ago

jdozierezell commented 2 years ago

I'm receiving the following error when adding an image that exceeds the quota:

Uncaught (in promise) DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of '__LSM__' exceeded the quota.

Is there a way to catch that error and do something with it? Right now I have a loading indicator that activates on click but the indicator is not deactivating on error because I haven't been able to figure out how to catch it.

bluebill1049 commented 2 years ago

what are you trying to store in the session storage? there is a hard limit as far as i know.