angular-local-storage
angular-local-storage copied to clipboard
Option to disable cookie fallback
trafficstars
I've added an option to disable the cookie fallback when LocalStorage fails. I simply don't want to use Cookies in my project as they don't support the amount of data and I need the return values for error handling - which are not reliable when working with the cookie fallback:
- Cookie fallback only works when LocalStorage is completely unavailable (browser does not support it). If saving to Local Storage fails because it is full (5MB/10MB depending on browser) - the select won't go for the cookie value and return either null or the previous value from local storage.
- Error Handling/return values seem not to work with cookies! When saving large data to cookies the browser simply ignores it and the method returns true even if it failed! LocalStorage throws the exception which gets already catched.
I like this feature. Currently it cannot be merged in and it is failing the tests.
Can you:
- Patch this PR so it can be merged into master
- Patch this PR so it passes the tests
- Write a test for disabling cookie fallback
- Update the version number
Thanks!