Socket
Socket
Sign inDemoInstall

cqrs-eventdenormalizer

Package Overview
Dependencies
Maintainers
2
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cqrs-eventdenormalizer - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

32

lib/definitions/viewBuilder.js

@@ -59,3 +59,3 @@ 'use strict';

this.denormFn = denormFn;
if (denormFn.length === 2) {

@@ -65,3 +65,3 @@ this.denormFn = function (evtData, vm, clb) {

clb(null);
}
};
}

@@ -290,5 +290,10 @@

if (this.query) {
var query = this.query;
if (!query && this.getQueryForThisViewBuilder) {
query = this.getQueryForThisViewBuilder(evt);
}
if (query) {
var notifications = [];
this.findViewModels(this.query, function (err, vms) {
this.findViewModels(query, function (err, vms) {
if (err) {

@@ -344,2 +349,21 @@ debug(err);

},
/**
* Inject useAsQuery function if no query and no id found.
* @param {Function} fn The function to be injected.
* @returns {ViewBuilder} to be able to chain...
*/
useAsQuery: function (fn) {
if (!fn || !_.isFunction(fn)) {
var err = new Error('Please pass a valid function!');
debug(err);
throw err;
}
this.getQueryForThisViewBuilder = function (evt) {
return fn(evt);
};
return this;
}

@@ -346,0 +370,0 @@

2

package.json
{
"author": "adrai",
"name": "cqrs-eventdenormalizer",
"version": "1.1.5",
"version": "1.1.6",
"private": false,

@@ -6,0 +6,0 @@ "main": "index.js",

@@ -398,3 +398,3 @@ # Introduction

// optional, if not defined or not found it will generate a new viewmodel with new id
query: '{ group: 'admins' }',
query: { group: 'admins' },

@@ -407,2 +407,6 @@ // optional, if not defined it will pass the whole event...

});
// optional define a function to that returns a query that will be used as query to find the viewmodels (but do not define the query in the options)
//.useAsQuery(function (evt) {
// return { my: evt.payload.my };
//});

@@ -409,0 +413,0 @@ ## EventExtender

@@ -0,1 +1,4 @@

## [v1.1.6](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.5...v1.1.6)
- added possibility to denormalize multiple viewmodels in same collection with intelligent queries
## [v1.1.5](https://github.com/adrai/node-cqrs-eventdenormalizer/compare/v1.1.4...v1.1.5)

@@ -2,0 +5,0 @@ - async viewBuilders

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc