Source

Source

Abstract class that defines contract for record sources

Constructor

new Source()

Source:

Methods

(static) instance() → {Source}

Gets the source singleton

Source:
Returns:
Type:
Source

filter(records) → {Array.<Record>}

Filters records based on configuration The filters are set in the config as a key and set of values, such as:

filters: {
  property: ['value1', 'value2'],
}

The property is taken from the meta attribute of the record

Source:
Parameters:
Name Type Description
records Array.<Record>
Returns:
Type:
Array.<Record>

The records after the filter is applied

(async) loadAll() → {Promise.<Array.<Record>>}

Loads all records - this function must be implemented by subclasses

Source:
Returns:
Type:
Promise.<Array.<Record>>

The records to be processed

(async) loadRecord(record) → {Promise.<void>}

Called just before the record is processed - for last minute operations

Source:
Parameters:
Name Type Description
record Record
Returns:
Type:
Promise.<void>