mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-14 08:58:02 -05:00
This is being merged for further testing so as to not block the progress of `develop` & not require more rebases.
13 lines
391 B
TypeScript
13 lines
391 B
TypeScript
export const get = (key: string): string | null =>
|
|
typeof window === 'undefined' ? null : localStorage.getItem(key);
|
|
|
|
export const set = (key: string, value: string): void => {
|
|
if (typeof window === 'undefined') return;
|
|
localStorage.setItem(key, value);
|
|
};
|
|
|
|
export const remove = (key: string): void => {
|
|
if (typeof window === 'undefined') return;
|
|
localStorage.removeItem(key);
|
|
};
|