-
-
Notifications
You must be signed in to change notification settings - Fork 40
Develop #20
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
Conversation
Update index.js
src/index.js
Outdated
| 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
src/index.js
Outdated
| 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
src/index.js
Outdated
| ? window.localStorage | ||
| : Memory; | ||
| let store; | ||
| ['localStorage', 'sessionStorage'].forEach( v => { |
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.
'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').
src/index.js
Outdated
| const store = typeof window !== 'undefined' && 'localStorage' in window | ||
| ? window.localStorage | ||
| : Memory; | ||
| let store; |
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).
src/index.js
Outdated
| try { | ||
| store = typeof window !== 'undefined' && v in window ? window[v] : undefined; | ||
| } catch (e) { | ||
| console.log(`${v} Error ${e.toString()}`); // eslint-disable-line |
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.
'template literal syntax' is only available in ES6 (use 'esversion: 6').
src/index.js
Outdated
| break; | ||
|
|
||
| case 'session': store = typeof window !== 'undefined' && 'sessionStorage' in window | ||
| ? window.sessionStorage |
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.
Misleading line break before '?'; readers may interpret this as an expression boundary.
src/index.js
Outdated
|
|
||
| switch(_options.storage) { // eslint-disable-line | ||
| case 'local': store = typeof window !== 'undefined' && 'localStorage' in window | ||
| ? window.localStorage |
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.
Misleading line break before '?'; readers may interpret this as an expression boundary.
|
|
||
| case 'session': | ||
| store = typeof window !== 'undefined' && 'sessionStorage' in window | ||
| ? window.sessionStorage |
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.
Misleading line break before '?'; readers may interpret this as an expression boundary.
| switch(_options.storage) { // eslint-disable-line | ||
| case 'local': | ||
| store = typeof window !== 'undefined' && 'localStorage' in window | ||
| ? window.localStorage |
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.
Misleading line break before '?'; readers may interpret this as an expression boundary.
No description provided.