beforeUpdate(inst /* , opts */) {
        const promiseArr = [];
        const unpublished = inst.previous('isPublished') && !inst.isPublished;
        const renamed = inst.previous('name') !== inst.name;
        if (unpublished || renamed) {
          const action = unpublished ? 'unpublish' : 'rename';
          promiseArr.push(inst.checkGeneratorReferences(action));
        }

        /*
         * If aspect is published and tags change or unpublished,
         * send a "del" realtime event for all the
         * samples for this aspect. (The afterUpdate hook
         * will send an "add" event.) This way, perspectives
         * which filter by aspect tags will get the right samples.
         */
        if (inst.isPublished && common.tagsChanged(inst) ||
          (inst.changed('isPublished') && inst.previous('isPublished'))) {
          promiseArr.push(redisOps.getSamplesFromAspectName(inst.name)
            .each((samp) => {
              if (samp) {
                publishSample(
                  samp, seq.models.Subject, sampleEventNames.del,
                  seq.models.Aspect
                );
              }
            })
          );
        } // tags changed

        return seq.Promise.all(promiseArr);
      }
/**
       * Check Generator references before unpublishing or renaming
       * @param {Aspect} inst - The instance being updated
       * @returns {Promise}
       */
Check Generator references before unpublishing or renaming
@param {Aspect} inst - The instance being updated
@returns {Promise}
Check Generator references before unpublishing or renaming @param { Aspect } inst - The instance being updated @returns { Promise }
beforeUpdate(inst ) {
        const promiseArr = [];
        const unpublished = inst.previous('isPublished') && !inst.isPublished;
        const renamed = inst.previous('name') !== inst.name;
        if (unpublished || renamed) {
          const action = unpublished ? 'unpublish' : 'rename';
          promiseArr.push(inst.checkGeneratorReferences(action));
        }
        if (inst.isPublished && common.tagsChanged(inst) ||
          (inst.changed('isPublished') && inst.previous('isPublished'))) {
          promiseArr.push(redisOps.getSamplesFromAspectName(inst.name)
            .each((samp) => {
              if (samp) {
                publishSample(
                  samp, seq.models.Subject, sampleEventNames.del,
                  seq.models.Aspect
                );
              }
            })
          );
        } 
        return seq.Promise.all(promiseArr);
      }
beforeUpdate ( inst ) { const promiseArr = [ ] ; const unpublished = inst . previous ( 'isPublished' ) && ! inst . isPublished ; const renamed = inst . previous ( 'name' ) !== inst . name ; if ( unpublished || renamed ) { const action = unpublished ? 'unpublish' : 'rename' ; promiseArr . push ( inst . checkGeneratorReferences ( action ) ) ; } if ( inst . isPublished && common . tagsChanged ( inst ) || ( inst . changed ( 'isPublished' ) && inst . previous ( 'isPublished' ) ) ) { promiseArr . push ( redisOps . getSamplesFromAspectName ( inst . name ) . each ( ( samp ) => { if ( samp ) { publishSample ( samp , seq . models . Subject , sampleEventNames . del , seq . models . Aspect ) ; } } ) ) ; } return seq . Promise . all ( promiseArr ) ; }
Check Generator references before unpublishing or renaming
 @param {Aspect} inst - The instance being updated
 @returns {Promise}
Check Generator references before unpublishing or renaming @param { Aspect } inst - The instance being updated @returns { Promise }
/* , opts */ /*
         * If aspect is published and tags change or unpublished,
         * send a "del" realtime event for all the
         * samples for this aspect. (The afterUpdate hook
         * will send an "add" event.) This way, perspectives
         * which filter by aspect tags will get the right samples.
         */ // tags changed