Class: LocalStorage

coreutils. LocalStorage


new LocalStorage()

Static helper class for local storage

Methods


<static> clear()

Clear all saved items in local storage
Returns:
returns self for chaining
Type
coreutils.LocalStorage

<static> getItem(id)

Get saved value
Parameters:
Name Type Description
id string
Returns:
Type
object | null

<static> hasItem(id)

Check if there exists saved item
Parameters:
Name Type Description
id string
Returns:
Type
boolean

<static> isSupported()

Check if local storage is supported https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
Returns:
Type
boolean

<static> keys()

Get all keys in localStorage
Returns:
array of keys
Type
coreutils.LocalStorage

<static> removeItem(id)

Remove stored item
Parameters:
Name Type Description
id string
Returns:
returns self for chaining
Type
coreutils.LocalStorage

<static> setItem(id, value)

Set saved value
Parameters:
Name Type Description
id string
value object
Returns:
returns self for chaining
Type
coreutils.LocalStorage