addExtra(key, extra)
Adds extra to item's existing extra. New properties are added, existing are overwritten.
Arguments
key
(string): Key to store the extra under (represents given item).extra
(object): Extra data to store.
Throws
If
extra
is not an object, it will throw'extra' must be an object.
Lifecycle
preAddExtra
Event name:
preAddExtra
Properties passed:cacheInstance
reference to cache instance (this
)key
key passed toaddExtra
methodextra
extra passed toaddExtra
method
Returns: (object): object containing properties:
cacheInstance
reference to cache instance (this
)key
key passed through handlers added forpreAddExtra
eventextra
extra passed through handlers added forpreAddExtra
event
postAddExtra
Event name:
postAddExtra
Properties passed:cacheInstance
reference to cache instance (this
) returned bypreAddExtra
key
key returned bypreAddExtra
extra
extra (object) returned by adapter using its addExtra method
Returns: (object): object containing properties:
cacheInstance
reference to cache instance (this
)key
key passed through handlers added forpostAddExtra
eventextra
extra passed through handlers added forpostAddExtra
event
Eventually
addExtra
returns extra returned bypostAddExtra
.
Example
Last updated