save - PeterNaydenov/code-assembly-line GitHub Wiki

Save current data as ... There are three options: template, data, process

  • template: Mostly used for multistep rendering;
  • process: Provide process as render of template + missing data;
  • data: Creates data that is ready to use from other processes;

Process save also checks for:

  • Current-data is in proper format. All savings are in current-data is a string. All templates are strings;
  • If template name already exists and configuration settings for overwriting them;

Fields

 { 
      do      : 'save'
    , as      : place
    , name    : itemName
    , method ?: saveMethod
 }

Types

  • place: 'template' | 'process' | 'data' | 'block'. How to save the result.
  • itemName: string. Save result with this name.
  • saveMethod: 'add' | 'update' | 'overwrite' | 'heap'. How to save the result. Default value is add. Possible values:
    • add(default): Add only a non-existing values. Do not change fields that already exist;
    • update: Overwrite only existing fields. Do not add new records;
    • overwrite : Overwrite existing record;
    • heap : Combine the old and the new value;

Example

  { do: 'save', as: 'template', name: 'theme1/login' }

Will create new template 'theme1/login' and will put there the information from current-data. If template name already exists will keep existing record.