mirror of
https://github.com/SomboChea/ui
synced 2024-11-04 21:54:30 +07:00
13 lines
244 B
TypeScript
13 lines
244 B
TypeScript
|
import memoryStorage from 'localstorage-memory';
|
||
|
|
||
|
let storage;
|
||
|
try {
|
||
|
localStorage.setItem('__TEST__', '');
|
||
|
localStorage.removeItem('__TEST__');
|
||
|
storage = localStorage;
|
||
|
} catch (err) {
|
||
|
storage = memoryStorage;
|
||
|
}
|
||
|
|
||
|
export default storage;
|