Methods
generate(storage, id) → {String}
refs.generate('items', 'abc'); // 'items/abc'
Parameters:
Name | Type | Description |
---|---|---|
storage |
String | |
id |
String |
Throws:
-
StorageName must be a string!
-
Id must be a string!
Returns:
ref
- Type
- String
get(ref, callbackopt) → {Object|undefined}
refs.get('items/abc'); // 123
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ref |
String | ||
callback |
Refs~callback |
<optional> |
Returns:
[document]
- Type
- Object | undefined
id(ref) → {String}
Parameters:
Name | Type | Description |
---|---|---|
ref |
String |
Returns:
id
- Type
- String
parse(ref) → {Array.<String>|undefined}
refs.parse('items/abc'); // ['items','abc']
Parameters:
Name | Type | Description |
---|---|---|
ref |
String |
Returns:
[_ref]
- Type
- Array.<String> | undefined
storage(ref) → {*}
Parameters:
Name | Type | Description |
---|---|---|
ref |
String |
Returns:
[storage]
- Type
- *
Type Definitions
callback(erroropt, dataopt)
Callback from get method.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
error |
Error |
<optional> |
|
data |
* |
<optional> |
getter(id, callbackopt) → {*}
Adapter for get data from storage by id.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
String | ||
callback |
Refs~callback |
<optional> |
Returns:
[data]
- Type
- *