mirror of
https://github.com/status-im/safe-react.git
synced 2025-01-10 10:05:38 +00:00
26 lines
338 B
JavaScript
26 lines
338 B
JavaScript
class LocalStorageMock {
|
|
store
|
|
|
|
constructor() {
|
|
this.store = {}
|
|
}
|
|
|
|
clear() {
|
|
this.store = {}
|
|
}
|
|
|
|
getItem(key) {
|
|
return this.store[key] || null
|
|
}
|
|
|
|
setItem(key, value) {
|
|
this.store[key] = value.toString()
|
|
}
|
|
|
|
removeItem(key) {
|
|
delete this.store[key]
|
|
}
|
|
}
|
|
|
|
global.localStorage = new LocalStorageMock()
|