delete simulation

This commit is contained in:
Matei Adriel 2019-07-25 17:40:28 +03:00
parent cddb050dfe
commit 96ae3f44a1
11 changed files with 112 additions and 42 deletions
src/modules/storage/classes

View file

@ -50,4 +50,12 @@ export class LocalStore<T> {
currentData[finalKey] = finalValue
localStorage.setItem(this.name, JSON.stringify(currentData))
}
public delete(key = 'index') {
const all = this.getAll()
delete all[key]
localStorage.setItem(this.name, JSON.stringify(all))
}
}