APIs

Show:

Item Index

Methods

Methods

get

(
  • key
  • prefix
)
Mixed

get a key/value pair from local storage update an item in localStorage

Parameters:

  • key String

    Key of property

  • prefix String

    Prefix to key of property

Returns:

Mixed:

set value or null

getObject

(
  • key
  • prefix
)
Mixed

Get a key/value pair from local storage NOTE: This method uses JSON.parse() to unserialize keys stored in local storage. If a value is not stored as valid JSON, this method will throw an error.

Parameters:

  • key String

    Key of property

  • prefix String

    Prefix to key of property

Returns:

Mixed:

set value or null

remove

(
  • key
  • prefix
)
Undefined

remove an item from localStorage

Parameters:

  • key String

    Key of property

  • prefix String

    Prefix to key of property

Returns:

Undefined:

set

(
  • key
  • value
  • prefix
)
Undefined

set a key/value pair in local storage update an item in localStorage

Parameters:

  • key String

    Key of property

  • value Mixed

    Value of property

  • prefix String

    Prefix to key of property

Returns:

Undefined:

setObject

(
  • key
  • value
  • prefix
)
Undefined

Set a key/value pair in local storage as a JSON string. NOTE: If the value has a toJSON method, that method will be used to serialize this value. This may cause unexpected results when getObject is used to get the value.

Parameters:

  • key String

    Key of property

  • value Mixed

    Value of property

  • prefix String

    Prefix to key of property

Returns:

Undefined:

update

(
  • key
  • value
)
Undefined deprecated

update an item in localStorage

Parameters:

  • key String

    Key of property

  • value Mixed

    Value of propert

Returns:

Undefined: