Class: StorageUtil
Defined in: src/util/StorageUtil.ts:5
Thin wrapper over localStorage for persisting and retrieving JSON data tables.
Constructors
Constructor
new StorageUtil():
StorageUtil
Returns
StorageUtil
Properties
localData
staticlocalData:any
Defined in: src/util/StorageUtil.ts:8
The most recently loaded data table.
Methods
load()
staticload<T>(dataTable):T
Defined in: src/util/StorageUtil.ts:14
Load a JSON data table from local storage, creating an empty one if absent.
Type Parameters
T
T
Parameters
dataTable
string
storage key
Returns
T
the parsed data, typed as T
save()
staticsave<T>(table,data):void
Defined in: src/util/StorageUtil.ts:30
Serialize and persist a data table to local storage.
Type Parameters
T
T
Parameters
table
string
storage key
data
T
value to persist
Returns
void

