The SavedData functions use localStorage and sessionStorage, with a cookie fallback.
read
name
Read the value of a saved variable
name
String
The name of the variable
The value (run through JSON.parse()
) or null if it doesn't exist
remove
name
Remove a saved variable by name.
name
String
The name of the value to remove
reviver
key
value
When restoring from JSON via JSON.parse
, we may pass a reviver function.
In our case, this will check if the object has a specially-named property (__classname
).
If it does, we will attempt to construct a new instance of that class, rather than using a
plain old Object. Note that this recurses through the object.
The object that was parsed - either cast to a class, or not
WEB_STORAGE_SUPPORT
A constant to determine if we can use localStorage and sessionStorage