-
-
Notifications
You must be signed in to change notification settings - Fork 40
Update index.js #19
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
Update index.js #19
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| import Memory from './memory'; | ||
| import Storage from './storage'; | ||
|
|
||
| const store = typeof window !== 'undefined' && 'localStorage' in window | ||
| ? window.localStorage | ||
| : Memory; | ||
| let store; | ||
| ['localStorage', 'sessionStorage'].forEach( v => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6'). |
||
| if (store) return; | ||
| try { | ||
| store = typeof window !== 'undefined' && v in window ? window[v] : undefined; | ||
| } catch (e) { console.log(v + ' error: ' + e) } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. |
||
| }) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. |
||
| if (!store) store = Memory; | ||
| const ls = new Storage(store); | ||
|
|
||
| const VueLocalStorage = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).