addExtra(key, extra)

Adds extra to given item.

Arguments

  1. key (string): Key to store the extra under (represents given item).

  2. extra (object): Extra data to store.

Returns

(object): The extra part of Item including new or overwritten data that's been passed to be added.

(undefined): If item is not found (thus no extra can be added), returns undefined.

Example

// `extra` will be either an object or undefined - depending if item exists or not
const extra = adapter.addExtra('key', { some: 'data' });

Last updated