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 109

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

##### Parameters:

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

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

##### Returns:

prefix

Type
  String

#### (static) getUserItem(key)

Get a user item from storage.

##### Parameters:

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

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

##### Returns:

user item

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

Increments value

##### Parameters:

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

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

#### (static) onStorage(e)

Triggered if changes are recognized

##### Parameters:

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

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

#### (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 252

##### 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 145

#### (static) removeUserItem(key)

Remove user item from storage.

##### Parameters:

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

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

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

Save or update buddy data.

##### Parameters:

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

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

##### 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 55

#### (static) updateItem(key, variable, valueopt, uk)

Updates value of a variable in a saved object.

##### Parameters:

Name | Type | Attributes | 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 185

#### (static) updateUserItem(type, key, variable, valueopt)

Updates value of a variable in a saved user object.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`type` | String |  | variable type (a prefix)
`key` | String |  | variable name
`variable` | String | object |  | variable name in object or object with variable/key pairs
`value` | Object | <optional> | value (not used if the variable was an object)

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