JSDoc: Namespace: storage

# Namespace: storage

## jsxc. storage

Handle long-live data

Source:
  - jsxc.lib.storage.js, line 1

### Members

#### <static> PREFIX

  Prefix for localstorage
  Source:
    - jsxc.lib.storage.js, line 12

### Methods

#### <static> getItem(key, uk)

  Load item from storage

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | String | variablename
  `uk` | String | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 89

#### <static> getPrefix(uk) → {String}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `uk` | type | Should we generate a user prefix?

  Source:
    - jsxc.lib.storage.js, line 21

  ##### Returns:

  prefix
  Type
    String

#### <static> getUserItem(key)

  Get a user item from storage.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` |  |

  Source:
    - jsxc.lib.storage.js, line 106

  ##### Returns:

  user item

#### <static> ink(key, uk)

  Inkrements value

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | String | variablename
  `uk` | String | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 218

#### <static> onStorage(e)

  Triggered if changes are recognized

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `e` | event | Storageevent ###### Properties
  Name | Type | Description
  --- | --- | ---
  `key` | String | Keyname which triggered event
  `oldValue` | Object | Old Value for key
  `newValue` | Object | New Value for key
  `url` | String |

  Source:
    - jsxc.lib.storage.js, line 268

#### <static> removeElement(key, name, uk) → {undefined}

  Remove element from array or object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | string | name of array or object
  `name` | string | name of element in array or object
  `uk` | String | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 231

  ##### Returns:

  Type
    undefined

#### <static> removeItem(key, uk)

  Remove item from storage

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | String | variablename
  `uk` | String | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 125

#### <static> removeUserItem(key)

  Remove user item from storage.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` |  |

  Source:
    - jsxc.lib.storage.js, line 143

#### <static> saveBuddy(bid, data) → {String}

  Save or update buddy data.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `bid` |  |
  `data` |  |

  Source:
    - jsxc.lib.storage.js, line 576

  ##### Returns:

  Updated or created
  Type
    String

#### <static> setItem(key, value, uk)

  Save item to storage

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | String | variablename
  `value` | Object | value
  `uk` | String | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 39

#### <static> updateItem(key, variable, value, uk)

  Updates value of a variable in a saved object.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `key` | String |  | variablename
  `variable` | String | object |  | variablename in object or object with variable/key pairs
  `value` | Object | <optional> | value
  `uk` | String |  | Userkey? Should we add the bid as prefix?

  Source:
    - jsxc.lib.storage.js, line 165

#### <static> updateUserItem(key, variable, value)

  Updates value of a variable in a saved user object.

  ##### Parameters:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `key` | String |  | variablename
  `variable` | String | object |  | variablename in object or object with variable/key pairs
  `value` | Object | <optional> | value

  Source:
    - jsxc.lib.storage.js, line 197