packages/mangojuice-core/src/classes/Process.js
function runLogicCreate(proc, rehydrate) {
  const { exec, logic, createArgs, model } = proc;
  if (logic.create) {
    const commandFactory = () => {
      logic.model = !rehydrate ? undefined : model;
      const res = logic.create.apply(logic, createArgs);
      logic.model = model;
      return res;
    };
    exec(commandFactory);
  }
}
function runLogicCreate(proc, rehydrate) {
  const { exec, logic, createArgs, model } = proc;
  if (logic.create) {
    const commandFactory = () => {
      logic.model = !rehydrate ? undefined : model;
      const res = logic.create.apply(logic, createArgs);
      logic.model = model;
      return res;
    };
    exec(commandFactory);
  }
}
function runLogicCreate ( proc , rehydrate ) { const { exec , logic , createArgs , model } = proc ; if ( logic . create ) { const commandFactory = ( ) => { logic . model = ! rehydrate ? undefined : model ; const res = logic . create . apply ( logic , createArgs ) ; logic . model = model ; return res ; } ; exec ( commandFactory ) ; } }
Run init command depending on from what state the logic
is runinng. Run `logic.rehydrate` if some model was provided
and `prepare` if model was not provided and we need to create
it from scratch.
@param  {Process} proc
Run init command depending on from what state the logic is runinng . Run logic . rehydrate if some model was provided and prepare if model was not provided and we need to create it from scratch .