lib/definitions/viewBuilder.js
function (evt, vm) {
    var notification = {};

    // event
    if (!!this.definitions.notification.meta && !!this.definitions.event.meta) {
      dotty.put(notification, this.definitions.notification.meta, _.cloneDeep(dotty.get(evt, this.definitions.event.meta)));
    }
    if (!!this.definitions.notification.eventId && !!this.definitions.event.id) {
      dotty.put(notification, this.definitions.notification.eventId, dotty.get(evt, this.definitions.event.id));
    }
    if (!!this.definitions.notification.event && !!this.definitions.event.name) {
      dotty.put(notification, this.definitions.notification.event, dotty.get(evt, this.definitions.event.name));
    }
    if (!!this.definitions.notification.aggregateId && !!this.definitions.event.aggregateId) {
      dotty.put(notification, this.definitions.notification.aggregateId, dotty.get(evt, this.definitions.event.aggregateId));
    }
    if (!!this.definitions.notification.aggregate && !!this.definitions.event.aggregate) {
      dotty.put(notification, this.definitions.notification.aggregate, dotty.get(evt, this.definitions.event.aggregate));
    }
    if (!!this.definitions.notification.context && !!this.definitions.event.context) {
      dotty.put(notification, this.definitions.notification.context, dotty.get(evt, this.definitions.event.context));
    }
    if (!!this.definitions.notification.revision && !!this.definitions.event.revision) {
      dotty.put(notification, this.definitions.notification.revision, dotty.get(evt, this.definitions.event.revision));
    }
    dotty.put(notification, this.definitions.notification.correlationId, dotty.get(evt, this.definitions.event.correlationId));

    // vm
    dotty.put(notification, this.definitions.notification.payload, vm.toJSON());
    dotty.put(notification, this.definitions.notification.collection, this.collection.name);
    dotty.put(notification, this.definitions.notification.action, vm.actionOnCommit);

    return notification;
  }
function (evt, vm) {
    var notification = {};

    // event
    if (!!this.definitions.notification.meta && !!this.definitions.event.meta) {
      dotty.put(notification, this.definitions.notification.meta, _.cloneDeep(dotty.get(evt, this.definitions.event.meta)));
    }
    if (!!this.definitions.notification.eventId && !!this.definitions.event.id) {
      dotty.put(notification, this.definitions.notification.eventId, dotty.get(evt, this.definitions.event.id));
    }
    if (!!this.definitions.notification.event && !!this.definitions.event.name) {
      dotty.put(notification, this.definitions.notification.event, dotty.get(evt, this.definitions.event.name));
    }
    if (!!this.definitions.notification.aggregateId && !!this.definitions.event.aggregateId) {
      dotty.put(notification, this.definitions.notification.aggregateId, dotty.get(evt, this.definitions.event.aggregateId));
    }
    if (!!this.definitions.notification.aggregate && !!this.definitions.event.aggregate) {
      dotty.put(notification, this.definitions.notification.aggregate, dotty.get(evt, this.definitions.event.aggregate));
    }
    if (!!this.definitions.notification.context && !!this.definitions.event.context) {
      dotty.put(notification, this.definitions.notification.context, dotty.get(evt, this.definitions.event.context));
    }
    if (!!this.definitions.notification.revision && !!this.definitions.event.revision) {
      dotty.put(notification, this.definitions.notification.revision, dotty.get(evt, this.definitions.event.revision));
    }
    dotty.put(notification, this.definitions.notification.correlationId, dotty.get(evt, this.definitions.event.correlationId));

    // vm
    dotty.put(notification, this.definitions.notification.payload, vm.toJSON());
    dotty.put(notification, this.definitions.notification.collection, this.collection.name);
    dotty.put(notification, this.definitions.notification.action, vm.actionOnCommit);

    return notification;
  }
function ( evt , vm ) { var notification = { } ; // event if ( ! ! this . definitions . notification . meta && ! ! this . definitions . event . meta ) { dotty . put ( notification , this . definitions . notification . meta , _ . cloneDeep ( dotty . get ( evt , this . definitions . event . meta ) ) ) ; } if ( ! ! this . definitions . notification . eventId && ! ! this . definitions . event . id ) { dotty . put ( notification , this . definitions . notification . eventId , dotty . get ( evt , this . definitions . event . id ) ) ; } if ( ! ! this . definitions . notification . event && ! ! this . definitions . event . name ) { dotty . put ( notification , this . definitions . notification . event , dotty . get ( evt , this . definitions . event . name ) ) ; } if ( ! ! this . definitions . notification . aggregateId && ! ! this . definitions . event . aggregateId ) { dotty . put ( notification , this . definitions . notification . aggregateId , dotty . get ( evt , this . definitions . event . aggregateId ) ) ; } if ( ! ! this . definitions . notification . aggregate && ! ! this . definitions . event . aggregate ) { dotty . put ( notification , this . definitions . notification . aggregate , dotty . get ( evt , this . definitions . event . aggregate ) ) ; } if ( ! ! this . definitions . notification . context && ! ! this . definitions . event . context ) { dotty . put ( notification , this . definitions . notification . context , dotty . get ( evt , this . definitions . event . context ) ) ; } if ( ! ! this . definitions . notification . revision && ! ! this . definitions . event . revision ) { dotty . put ( notification , this . definitions . notification . revision , dotty . get ( evt , this . definitions . event . revision ) ) ; } dotty . put ( notification , this . definitions . notification . correlationId , dotty . get ( evt , this . definitions . event . correlationId ) ) ; // vm dotty . put ( notification , this . definitions . notification . payload , vm . toJSON ( ) ) ; dotty . put ( notification , this . definitions . notification . collection , this . collection . name ) ; dotty . put ( notification , this . definitions . notification . action , vm . actionOnCommit ) ; return notification ; }
Generates a notification from event and viewModel.
@param {Object} evt The event object.
@param {Object} vm  The viewModel.
@returns {Object}
Generates a notification from event and viewModel .