I am began get this error suddenly. I'm using webpack and babel. in my storage class everything fine.
I'm using storege class like this
import Storage from './storage'
let DB = new Storage();
I didn't update the babel. I don't know source of error maybe webpack?
- "babel-core": "^6.25.0"
- "babel-loader": "^7.1.1"
- "babel-preset-es2015": "^6.24.1"
- "webpack": "^3.3.0"
my storage.js look like this
import localStorage from './localStorage'
import View from './view'
let lStore = new localStorage();
let V = new View();
let data = (lStore.get('todo')) ? JSON.parse(lStore.get('todo')):{
todo: [],
complated: []
};
export default class Storage {
addItem(text, id){
/* Store */
this.store(text);
/* Add HTML Item */
V.addToDOM(text, id);
}
store(text){
data.todo.push(text);
data.complated.push(false);
//sync
this.objectLocalStorage();
}
list() {
return data;
}
updateItem(id, complated){
/* */
data.complated[id] = complated;
//sync
this.objectLocalStorage();
}
deleteItem(id){
data.complated.splice(id, 1);
data.todo.splice(id, 1);
//sync
this.objectLocalStorage();
}
/* Local Storage Set-Update-Sync */
objectLocalStorage() {
lStore.set('todo', JSON.stringify(data));
}}