Skip to content

remove dep on globalthis #148

Open
Open

Description

@jimmywarting

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...

Activity

  1. dzienisz commented on Nov 15, 2022

    @dzienisz

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions