lib/localPersistence/inputPersister.js
/**
   * Executes entries dispatch with a batch operations.
   *
   * @param {Object} payload the payload from which the data will be extracted.
   * @param {'put' | 'del'} operationType Type of operations that will be executed in batch.
   *
   * @public
   */
Executes entries dispatch with a batch operations.
@param {Object} payload the payload from which the data will be extracted.
@param {'put' | 'del'} operationType Type of operations that will be executed in batch.

@public
Executes entries dispatch with a batch operations . @param { Object } payload the payload from which the data will be extracted . @param { ' put ' | ' del ' } operationType Type of operations that will be executed in batch . @public
async dispatch(payload, operationType) {
    const operations = new Map();
    this.config.frames.forEach((frame) => {
      const levelConfig = this.config.levels[frame.level];
      const processedLevelConfig = this.prepareLevel(levelConfig, payload);
      const data = this.extractData(frame, payload);
      if (processedLevelConfig && processedLevelConfig.source && data) {
        if (operations.has(levelConfig.source)) {
          const opsLevel = operations.get(processedLevelConfig.name);
          opsLevel.operations.push({ key: data.key, value: data.value });
        } else {
          operations.set(
            processedLevelConfig.name,
            {
              config: processedLevelConfig,
              operations: operationType === INSERT_OPERATION ? [
                { type: operationType, key: data.key, value: data.value },
              ] : [
                { type: operationType, key: data.key },
              ],
            },
          );
        }
      }
    });
    await this.dojotPersistenceManager.executeBatchForLevels(operations);
  }
async dispatch ( payload , operationType ) { const operations = new Map ( ) ; this . config . frames . forEach ( ( frame ) => { const levelConfig = this . config . levels [ frame . level ] ; const processedLevelConfig = this . prepareLevel ( levelConfig , payload ) ; const data = this . extractData ( frame , payload ) ; if ( processedLevelConfig && processedLevelConfig . source && data ) { if ( operations . has ( levelConfig . source ) ) { const opsLevel = operations . get ( processedLevelConfig . name ) ; opsLevel . operations . push ( { key : data . key , value : data . value } ) ; } else { operations . set ( processedLevelConfig . name , { config : processedLevelConfig , operations : operationType === INSERT_OPERATION ? [ { type : operationType , key : data . key , value : data . value } , ] : [ { type : operationType , key : data . key } , ] , } , ) ; } } } ) ; await this . dojotPersistenceManager . executeBatchForLevels ( operations ) ; }
Executes entries dispatch with a batch operations.
Executes entries dispatch with a batch operations .