ryde/source/logic/helpers/storage.ts

40 lines
408 B
TypeScript
Raw Normal View History

2026-03-06 08:37:53 +01:00
namespace lib_storage
{
/**
*/
export function write
(
key : string,
value : any
) : void
{
window.localStorage.setItem(key, JSON.stringify(value));
}
/**
*/
export function read
(
key : string
) : any
{
return JSON.parse(window.localStorage.getItem(key));
}
/**
*/
export function kill
(
key : string
) : any
{
return window.localStorage.removeItem(key);
}
}