add storage functions

This commit is contained in:
JW
2021-11-28 00:38:36 +01:00
parent 04e44183a2
commit 447ef6ac65
9 changed files with 243 additions and 2 deletions

20
sim/state/storage.ts Normal file
View File

@ -0,0 +1,20 @@
namespace pxsim.storage {
export function putValue(key: string, value: string) : void {
sessionStorage.setItem('simulatorValue_'+key, value);
}
export function getValue(key: string) : string {
if(sessionStorage.getItem('simulatorValue_'+key)) {
return sessionStorage.getItem('simulatorValue_'+key);
} else {
return "";
}
}
export function remove(key: string) : void {
sessionStorage.removeItem('simulatorValue_'+key);
}
}