core/sessionstorage

Simple API for set/get to sessionstorage, with cacherev expiration.

Session storage will only persist for as long as the browser window stays open.

See: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(inner) StorageWrapper :Object

Source:

Wraps browsers sessionStorage object

Type:
  • Object

Methods

(inner) get(key) → {boolean|string}

Source:

Get a value from session storage. Remember - all values must be strings.

Parameters:
Name Type Description
key string

The cache key to check.

Returns:

False if the value is not in the cache, or some other error - a string otherwise.

Type
boolean | string

(inner) set(key, value) → {boolean}

Source:

Set a value to session storage. Remember - all values must be strings.

Parameters:
Name Type Description
key string

The cache key to set.

value string

The value to set.

Returns:

False if the value can't be saved in the cache, or some other error - true otherwise.

Type
boolean