core/sessionstorage

Description:
  • 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

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

Members

(inner) StorageWrapper :Object

Description:
  • Wraps browsers sessionStorage object

Source:

Wraps browsers sessionStorage object

Type:
  • Object

Methods

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

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

Source:
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}

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

Source:
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