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

Methods

# 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 118

number

# 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 109

number

# read() → {State}

Reads and decodes the locally stored data.

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

State

# write() → {State}

Encodes and writes the data to the local storage.

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

State