Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dep on globalthis #148

Open
jimmywarting opened this issue Aug 7, 2022 · 1 comment
Open

remove dep on globalthis #148

jimmywarting opened this issue Aug 7, 2022 · 1 comment

Comments

@jimmywarting
Copy link

seriously, you do not need globalThis...

clientjs/src/client.base.js

Lines 580 to 586 in 08cb26b

isLocalStorage: function() {
try {
return !!globalThis.localStorage;
} catch (e) {
return true; // SecurityError when referencing it means it exists
}
},

just use typeof LocalStorage !== 'undefined' instead... don't even need a try catch for that...

@dzienisz
Copy link

hey @jimmywarting can you prepare PR for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants