A key/value pair in the session storage that holds a value of type T.
Make one as a constant, and use it wherever the value is needed:
const RUN = new SessionValue("run", () => new Run());
RUN.get().lives -= 1;
For an object (or an array), get() gives back the stored object itself,
so changing it changes what is stored. For a number, a string or a
boolean, change it with set.
A key/value pair in the session storage that holds a value of type
T.Make one as a constant, and use it wherever the value is needed:
For an object (or an array),
get()gives back the stored object itself, so changing it changes what is stored. For a number, a string or a boolean, change it withset.