Class

State

(abstract) State(key)

A class to read and write local storage contents.
Constructor

# abstract new State(key)

Parameters:
Name Type Description
key string The local storage key.

View Source lib/state/State.ts, line 10

Members

Methods

# protected static remainingSecondsToTime(seconds) → {number}

Converts a number of seconds into a timestamp.
Parameters:
Name Type Description
seconds number Remaining seconds to be converted into a timestamp.

View Source lib/state/State.ts, line 128

number

# protected static timeToRemainingSeconds(time) → {number}

Converts a timestamp into remaining seconds that you can count down.
Parameters:
Name Type Description
time number Timestamp in seconds (since January 1, 1970 00:00:00 UTC).

View Source lib/state/State.ts, line 117

number

# protected read() → {State}

Reads and decodes the locally stored data.

View Source lib/state/State.ts, line 99

State

# write() → {State}

Encodes and writes the data to the local storage.

View Source lib/state/State.ts, line 106

State