@ngxs-contrib/emitter
Advanced tools
Comparing version 1.0.4 to 1.0.5
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store'), require('rxjs/operators')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@ngxs/store', 'rxjs/operators'], factory) : | ||
(factory((global['ngxs-contrib'] = global['ngxs-contrib'] || {}, global['ngxs-contrib'].emitter = {}),global.ng.core,global.ngxs.store,global.rxjs.operators)); | ||
typeof define === 'function' && define.amd ? define('@ngxs-contrib/emitter', ['exports', '@angular/core', '@ngxs/store', 'rxjs/operators'], factory) : | ||
(factory((global['ngxs-contrib'] = global['ngxs-contrib'] || {}, global['ngxs-contrib'].emitter = {}),global.ng.core,null,global.rxjs.operators)); | ||
}(this, (function (exports,core,store,operators) { 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
/** | ||
@@ -121,3 +95,3 @@ * @fileoverview added by tsickle | ||
*/ | ||
var InjectorAccessor = /** @class */ (function () { | ||
var InjectorAccessor = (function () { | ||
/** | ||
@@ -137,8 +111,8 @@ * Creates InjectorAccessor instance | ||
*/ | ||
function () { | ||
if (this.injector === null) { | ||
throw new Error("You've forgotten to import `NgxsEmitPluginModule`"); | ||
} | ||
return this.injector; | ||
}; | ||
function () { | ||
if (this.injector === null) { | ||
throw new Error("You've forgotten to import `NgxsEmitPluginModule`"); | ||
} | ||
return this.injector; | ||
}; | ||
/** | ||
@@ -152,8 +126,36 @@ * Injector for accessing DI | ||
/** @nocollapse */ | ||
InjectorAccessor.ctorParameters = function () { return [ | ||
{ type: core.Injector } | ||
]; }; | ||
InjectorAccessor.ctorParameters = function () { | ||
return [ | ||
{ type: core.Injector } | ||
]; | ||
}; | ||
return InjectorAccessor; | ||
}()); | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) | ||
if (b.hasOwnProperty(p)) | ||
d[p] = b[p]; }; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
/** | ||
@@ -167,3 +169,3 @@ * @fileoverview added by tsickle | ||
*/ | ||
var EmitterAction = /** @class */ (function () { | ||
var EmitterAction = (function () { | ||
/** | ||
@@ -188,3 +190,3 @@ * Creates EmitterAction instance | ||
*/ | ||
var EmitStore = /** @class */ (function (_super) { | ||
var EmitStore = (function (_super) { | ||
__extends(EmitStore, _super); | ||
@@ -204,16 +206,16 @@ function EmitStore() { | ||
*/ | ||
function (receiver) { | ||
var _this = this; | ||
var /** @type {?} */ receiverEvent = receiver[RECEIVER_META_KEY]; | ||
if (!receiverEvent) { | ||
throw new Error('Emitter methods should be decorated using @Emitter() decorator'); | ||
} | ||
return { | ||
emit: function (payload) { | ||
EmitterAction.type = receiverEvent.type; | ||
var /** @type {?} */ Action = receiverEvent.action ? receiverEvent.action : EmitterAction; | ||
return _this.dispatch(new Action(payload)); | ||
function (receiver) { | ||
var _this = this; | ||
var /** @type {?} */ receiverEvent = receiver[RECEIVER_META_KEY]; | ||
if (!receiverEvent) { | ||
throw new Error('Emitter methods should be decorated using @Emitter() decorator'); | ||
} | ||
return { | ||
emit: function (payload) { | ||
EmitterAction.type = receiverEvent.type; | ||
var /** @type {?} */ Action = receiverEvent.action ? receiverEvent.action : EmitterAction; | ||
return _this.dispatch(new Action(payload)); | ||
} | ||
}; | ||
}; | ||
}; | ||
EmitStore.decorators = [ | ||
@@ -250,3 +252,3 @@ { type: core.Injectable }, | ||
*/ | ||
var NgxsEmitPluginModule = /** @class */ (function () { | ||
var NgxsEmitPluginModule = (function () { | ||
function NgxsEmitPluginModule(injectorAccessor) { | ||
@@ -261,7 +263,7 @@ this.injectorAccessor = injectorAccessor; | ||
*/ | ||
function () { | ||
return { | ||
ngModule: NgxsEmitPluginModule | ||
function () { | ||
return { | ||
ngModule: NgxsEmitPluginModule | ||
}; | ||
}; | ||
}; | ||
NgxsEmitPluginModule.decorators = [ | ||
@@ -276,5 +278,7 @@ { type: core.NgModule, args: [{ | ||
/** @nocollapse */ | ||
NgxsEmitPluginModule.ctorParameters = function () { return [ | ||
{ type: InjectorAccessor, decorators: [{ type: core.Self }] } | ||
]; }; | ||
NgxsEmitPluginModule.ctorParameters = function () { | ||
return [ | ||
{ type: InjectorAccessor, decorators: [{ type: core.Self }] } | ||
]; | ||
}; | ||
return NgxsEmitPluginModule; | ||
@@ -291,18 +295,18 @@ }()); | ||
* | ||
* @param {?} emitters | ||
* @param {?} receivers - Array with references to the static functions | ||
* @return {?} - A key-value map where a key is a type and value is `true` | ||
*/ | ||
function getReceiverTypes(emitters) { | ||
function getReceiverTypes(receivers) { | ||
var /** @type {?} */ types = {}; | ||
var /** @type {?} */ i = emitters.length; | ||
var /** @type {?} */ i = receivers.length; | ||
while (i--) { | ||
var /** @type {?} */ emitter = emitters[i]; | ||
var /** @type {?} */ isNotFunction = typeof emitter !== 'function'; | ||
var /** @type {?} */ receiver = receivers[i]; | ||
var /** @type {?} */ isNotFunction = typeof receiver !== 'function'; | ||
if (isNotFunction) { | ||
throw new TypeError("Emitter should be a function, got " + emitter); | ||
throw new TypeError("Receiver should be a function, got " + receiver); | ||
} | ||
var /** @type {?} */ meta = emitter[RECEIVER_META_KEY]; | ||
var /** @type {?} */ meta = receiver[RECEIVER_META_KEY]; | ||
var /** @type {?} */ isNotAnnotated = !meta || !meta.type; | ||
if (isNotAnnotated) { | ||
throw new Error(emitter.name + " should be decorated using @Receiver() decorator"); | ||
throw new Error(receiver.name + " should be decorated using @Receiver() decorator"); | ||
} | ||
@@ -379,2 +383,12 @@ types[meta.type] = true; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
exports.Emitter = Emitter; | ||
@@ -395,1 +409,3 @@ exports.ofEmittableDispatched = ofEmittableDispatched; | ||
}))); | ||
//# sourceMappingURL=data:application/json;charset=utf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uZXcgVHlwZUVycm9yKFwiR2VuZXJhdG9yIGlzIGFscmVhZHkgZXhlY3V0aW5nLlwiKTtcclxuICAgICAgICB3aGlsZSAoXykgdHJ5IHtcclxuICAgICAgICAgICAgaWYgKGYgPSAxLCB5ICYmICh0ID0geVtvcFswXSAmIDIgPyBcInJldHVyblwiIDogb3BbMF0gPyBcInRocm93XCIgOiBcIm5leHRcIl0pICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gWzAsIHQudmFsdWVdO1xyXG4gICAgICAgICAgICBzd2l0Y2ggKG9wWzBdKSB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDA6IGNhc2UgMTogdCA9IG9wOyBicmVhaztcclxuICAgICAgICAgICAgICAgIGNhc2UgNDogXy5sYWJlbCsrOyByZXR1cm4geyB2YWx1ZTogb3BbMV0sIGRvbmU6IGZhbHNlIH07XHJcbiAgICAgICAgICAgICAgICBjYXNlIDU6IF8ubGFiZWwrKzsgeSA9IG9wWzFdOyBvcCA9IFswXTsgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDc6IG9wID0gXy5vcHMucG9wKCk7IF8udHJ5cy5wb3AoKTsgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghKHQgPSBfLnRyeXMsIHQgPSB0Lmxlbmd0aCA+IDAgJiYgdFt0Lmxlbmd0aCAtIDFdKSAmJiAob3BbMF0gPT09IDYgfHwgb3BbMF0gPT09IDIpKSB7IF8gPSAwOyBjb250aW51ZTsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gMyAmJiAoIXQgfHwgKG9wWzFdID4gdFswXSAmJiBvcFsxXSA8IHRbM10pKSkgeyBfLmxhYmVsID0gb3BbMV07IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAg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tBQVksRUFBRSxNQUFvQjtRQUMxRCxPQUFPLFVBQUMsTUFBaUM7WUFDckMsT0FBTyxNQUFNLENBQUMsSUFBSSxDQUNkQyxnQkFBTSxDQUFDLFVBQUMsR0FBa0I7Z0JBQ3RCLHFCQUFNLGNBQWMsR0FBRyxLQUFLLENBQUNDLCtCQUF5QixDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO2dCQUNwRSxxQkFBTSwyQkFBMkIsR0FBRyxHQUFHLENBQUMsTUFBTSxLQUFLLE1BQU0sQ0FBQztnQkFDMUQsT0FBTyxjQUFjLElBQUksMkJBQTJCLENBQUM7YUFDeEQsQ0FBQyxFQUNGQyxhQUFHLENBQUMsVUFBQyxFQUFnQztvQkFBOUIsa0JBQU0sRUFBRSxnQkFBSztnQkFBc0IsUUFBQztvQkFDdkMsSUFBSSxFQUFFRCwrQkFBeUIsQ0FBQyxNQUFNLENBQUM7b0JBQ3ZDLE9BQU8sRUFBRSxNQUFNLENBQUMsT0FBTztvQkFDdkIsS0FBSyxPQUFBO2lCQUNSO2FBQUMsQ0FBQyxDQUNOLENBQUM7U0FDTCxDQUFDO0tBQ0w7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9 |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@ngxs/store"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngxs-contrib/emitter",["exports","@angular/core","@ngxs/store","rxjs/operators"],e):e((t["ngxs-contrib"]=t["ngxs-contrib"]||{},t["ngxs-contrib"].emitter={}),t.ng.core,null,t.rxjs.operators)}(this,function(t,r,i,e){"use strict";var n="NGXS_META",u="NGXS_RECEIVER_META";function a(t){if(!t.hasOwnProperty(n)){Object.defineProperty(t,n,{value:{name:null,actions:{},defaults:{},path:null,children:[],instance:null}})}return function e(t){return t[n]}(t)}var o=function(){function e(t){e.injector=t}return e.getInjector=function(){if(null===this.injector)throw new Error("You've forgotten to import `NgxsEmitPluginModule`");return this.injector},e.injector=null,e.decorators=[{type:r.Injectable}],e.ctorParameters=function(){return[{type:r.Injector}]},e}(),c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};var f=function(){function t(t){this.payload=t}return t.type=null,t}(),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function n(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.emitter=function(t){var r=this,n=t[u];if(!n)throw new Error("Emitter methods should be decorated using @Emitter() decorator");return{emit:function(t){f.type=n.type;var e=n.action?n.action:f;return r.dispatch(new e(t))}}},e.decorators=[{type:r.Injectable}],e}(i.Store);var p=function(){function t(t){this.injectorAccessor=t}return t.forRoot=function(){return{ngModule:t}},t.decorators=[{type:r.NgModule,args:[{providers:[s,o]}]}],t.ctorParameters=function(){return[{type:o,decorators:[{type:r.Self}]}]},t}();function l(t){for(var e={},r=t.length;r--;){var n=t[r];if("function"!=typeof n)throw new TypeError("Emitter should be a function, got "+n);var o=n[u];if(!o||!o.type)throw new Error(n.name+" should be decorated using @Receiver() decorator");e[o.type]=!0}return e}function y(n,o){return function(t){return t.pipe(e.filter(function(t){var e=n[i.getActionTypeFromInstance(t.action)],r=t.status===o;return e&&r}),e.map(function(t){var e=t.action,r=t.error;return{type:i.getActionTypeFromInstance(e),payload:e.payload,error:r}}))}}t.Emitter=function d(r){return function(t,e){Object.defineProperty(t,e,{get:function(){return o.getInjector().get(s).emitter(r)}})}},t.ofEmittableDispatched=function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"DISPATCHED")},t.ofEmittableSuccessful=function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"SUCCESSFUL")},t.ofEmittableCanceled=function E(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"CANCELED")},t.ofEmittableErrored=function m(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"ERRORED")},t.Receiver=function v(c){return function(t,e,r){if(!r||"function"!=typeof r.value||"function"!=typeof t[e])throw new TypeError("Only static functions can be decorated with @Receiver() decorator");"symbol"==typeof e&&(e=e.toString());var n=a(t),o=c&&c.action;if(o&&"string"!=typeof o.type)throw new Error("Action type should be defined as a static property `type`");var i=o?o.type:c&&c.type||t.name+"."+e;if(n.actions[i])throw new Error("Method decorated with such type `"+i+"` already exists");n.actions[i]=[{fn:""+e,options:{},type:i}],r.value[u]={type:i,action:o},t.prototype[e]=function(){return t[e].apply(t,arguments)}}},t.EmitterAction=f,t.NgxsEmitPluginModule=p,t.ɵb=y,t.ɵc=s,t.ɵd=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@ngxs/store"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngxs-contrib/emitter",["exports","@angular/core","@ngxs/store","rxjs/operators"],e):e((t["ngxs-contrib"]=t["ngxs-contrib"]||{},t["ngxs-contrib"].emitter={}),t.ng.core,null,t.rxjs.operators)}(this,function(t,r,i,e){"use strict";var n="NGXS_META",u="NGXS_RECEIVER_META";function a(t){if(!t.hasOwnProperty(n)){Object.defineProperty(t,n,{value:{name:null,actions:{},defaults:{},path:null,children:[],instance:null}})}return function e(t){return t[n]}(t)}var o=function(){function e(t){e.injector=t}return e.getInjector=function(){if(null===this.injector)throw new Error("You've forgotten to import `NgxsEmitPluginModule`");return this.injector},e.injector=null,e.decorators=[{type:r.Injectable}],e.ctorParameters=function(){return[{type:r.Injector}]},e}(),c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};var f=function(){function t(t){this.payload=t}return t.type=null,t}(),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function n(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.emitter=function(t){var r=this,n=t[u];if(!n)throw new Error("Emitter methods should be decorated using @Emitter() decorator");return{emit:function(t){f.type=n.type;var e=n.action?n.action:f;return r.dispatch(new e(t))}}},e.decorators=[{type:r.Injectable}],e}(i.Store);var p=function(){function t(t){this.injectorAccessor=t}return t.forRoot=function(){return{ngModule:t}},t.decorators=[{type:r.NgModule,args:[{providers:[s,o]}]}],t.ctorParameters=function(){return[{type:o,decorators:[{type:r.Self}]}]},t}();function l(t){for(var e={},r=t.length;r--;){var n=t[r];if("function"!=typeof n)throw new TypeError("Receiver should be a function, got "+n);var o=n[u];if(!o||!o.type)throw new Error(n.name+" should be decorated using @Receiver() decorator");e[o.type]=!0}return e}function y(n,o){return function(t){return t.pipe(e.filter(function(t){var e=n[i.getActionTypeFromInstance(t.action)],r=t.status===o;return e&&r}),e.map(function(t){var e=t.action,r=t.error;return{type:i.getActionTypeFromInstance(e),payload:e.payload,error:r}}))}}t.Emitter=function d(r){return function(t,e){Object.defineProperty(t,e,{get:function(){return o.getInjector().get(s).emitter(r)}})}},t.ofEmittableDispatched=function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"DISPATCHED")},t.ofEmittableSuccessful=function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"SUCCESSFUL")},t.ofEmittableCanceled=function E(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"CANCELED")},t.ofEmittableErrored=function m(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(l(t),"ERRORED")},t.Receiver=function v(c){return function(t,e,r){if(!r||"function"!=typeof r.value||"function"!=typeof t[e])throw new TypeError("Only static functions can be decorated with @Receiver() decorator");"symbol"==typeof e&&(e=e.toString());var n=a(t),o=c&&c.action;if(o&&"string"!=typeof o.type)throw new Error("Action type should be defined as a static property `type`");var i=o?o.type:c&&c.type||t.name+"."+e;if(n.actions[i])throw new Error("Method decorated with such type `"+i+"` already exists");n.actions[i]=[{fn:""+e,options:{},type:i}],r.value[u]={type:i,action:o},t.prototype[e]=function(){return t[e].apply(t,arguments)}}},t.EmitterAction=f,t.NgxsEmitPluginModule=p,t.ɵb=y,t.ɵc=s,t.ɵd=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngxs-contrib-emitter.umd.min.js.map |
@@ -12,18 +12,18 @@ /** | ||
* | ||
* @param {?} emitters | ||
* @param {?} receivers - Array with references to the static functions | ||
* @return {?} - A key-value map where a key is a type and value is `true` | ||
*/ | ||
function getReceiverTypes(emitters) { | ||
function getReceiverTypes(receivers) { | ||
const /** @type {?} */ types = {}; | ||
let /** @type {?} */ i = emitters.length; | ||
let /** @type {?} */ i = receivers.length; | ||
while (i--) { | ||
const /** @type {?} */ emitter = emitters[i]; | ||
const /** @type {?} */ isNotFunction = typeof emitter !== 'function'; | ||
const /** @type {?} */ receiver = receivers[i]; | ||
const /** @type {?} */ isNotFunction = typeof receiver !== 'function'; | ||
if (isNotFunction) { | ||
throw new TypeError(`Emitter should be a function, got ${emitter}`); | ||
throw new TypeError(`Receiver should be a function, got ${receiver}`); | ||
} | ||
const /** @type {?} */ meta = emitter[RECEIVER_META_KEY]; | ||
const /** @type {?} */ meta = receiver[RECEIVER_META_KEY]; | ||
const /** @type {?} */ isNotAnnotated = !meta || !meta.type; | ||
if (isNotAnnotated) { | ||
throw new Error(`${emitter.name} should be decorated using @Receiver() decorator`); | ||
throw new Error(`${receiver.name} should be decorated using @Receiver() decorator`); | ||
} | ||
@@ -81,2 +81,2 @@ types[meta.type] = true; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2YtZW1pdHRhYmxlLmpzIiwic291cmNlUm9vdCI6Im5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SA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaGFzaE1hcEhhc1R5cGUgPSB0eXBlc1tnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGN0eC5hY3Rpb24pXTtcbiAgICAgICAgICAgICAgICBjb25zdCBjb250ZXh0SGFzVHJhbnNtaXR0ZWRTdGF0dXMgPSBjdHguc3RhdHVzID09PSBzdGF0dXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhc2hNYXBIYXNUeXBlICYmIGNvbnRleHRIYXNUcmFuc21pdHRlZFN0YXR1cztcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgbWFwKCh7IGFjdGlvbiwgZXJyb3IgfTogQWN0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGFjdGlvbiksXG4gICAgICAgICAgICAgICAgcGF5bG9hZDogYWN0aW9uLnBheWxvYWQsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH07XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2YtZW1pdHRhYmxlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyLyIsInNvdXJjZXMiOlsibGliL2NvcmUvb3BlcmF0b3JzL29mLWVtaXR0YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sYUFBYSxDQUFDO0FBR3hELE9BQU8sRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFN0MsT0FBTyxFQUFFLGlCQUFpQixFQUFrRixNQUFNLHVCQUF1QixDQUFDOzs7Ozs7OztBQVMxSSwwQkFBMEIsU0FBcUI7SUFDM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Jyb3IgfTogQWN0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGFjdGlvbiksXG4gICAgICAgICAgICAgICAgcGF5bG9hZDogYWN0aW9uLnBheWxvYWQsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH07XG59XG4iXX0= |
@@ -12,18 +12,18 @@ /** | ||
* | ||
* @param {?} emitters | ||
* @param {?} receivers - Array with references to the static functions | ||
* @return {?} - A key-value map where a key is a type and value is `true` | ||
*/ | ||
function getReceiverTypes(emitters) { | ||
function getReceiverTypes(receivers) { | ||
var /** @type {?} */ types = {}; | ||
var /** @type {?} */ i = emitters.length; | ||
var /** @type {?} */ i = receivers.length; | ||
while (i--) { | ||
var /** @type {?} */ emitter = emitters[i]; | ||
var /** @type {?} */ isNotFunction = typeof emitter !== 'function'; | ||
var /** @type {?} */ receiver = receivers[i]; | ||
var /** @type {?} */ isNotFunction = typeof receiver !== 'function'; | ||
if (isNotFunction) { | ||
throw new TypeError("Emitter should be a function, got " + emitter); | ||
throw new TypeError("Receiver should be a function, got " + receiver); | ||
} | ||
var /** @type {?} */ meta = emitter[RECEIVER_META_KEY]; | ||
var /** @type {?} */ meta = receiver[RECEIVER_META_KEY]; | ||
var /** @type {?} */ isNotAnnotated = !meta || !meta.type; | ||
if (isNotAnnotated) { | ||
throw new Error(emitter.name + " should be decorated using @Receiver() decorator"); | ||
throw new Error(receiver.name + " should be decorated using @Receiver() decorator"); | ||
} | ||
@@ -100,2 +100,2 @@ types[meta.type] = true; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2YtZW1pdHRhYmxlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyLyIsInNvdXJjZXMiOlsibGliL2NvcmUvb3BlcmF0b3JzL29mLWVta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iAoc291cmNlOiBPYnNlcnZhYmxlPEFjdGlvbkNvbnRleHQ+KSA9PiB7XG4gICAgICAgIHJldHVybiBzb3VyY2UucGlwZShcbiAgICAgICAgICAgIGZpbHRlcigoY3R4OiBBY3Rpb25Db250ZXh0KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaGFzaE1hcEhhc1R5cGUgPSB0eXBlc1tnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGN0eC5hY3Rpb24pXTtcbiAgICAgICAgICAgICAgICBjb25zdCBjb250ZXh0SGFzVHJhbnNtaXR0ZWRTdGF0dXMgPSBjdHguc3RhdHVzID09PSBzdGF0dXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhc2hNYXBIYXNUeXBlICYmIGNvbnRleHRIYXNUcmFuc21pdHRlZFN0YXR1cztcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgbWFwKCh7IGFjdGlvbiwgZXJyb3IgfTogQWN0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGFjdGlvbiksXG4gICAgICAgICAgICAgICAgcGF5bG9hZDogYWN0aW9uLnBheWxvYWQsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH07XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2YtZW1pdHRhYmxlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyLyIsInNvdXJjZXMiOlsibGliL2NvcmUvb3BlcmF0b3JzL29mLWVtaXR0YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sYUFBYSxDQUFDO0FBR3hELE9BQU8sRUFBRSxNQUFNLEVBQUU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KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaGFzaE1hcEhhc1R5cGUgPSB0eXBlc1tnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGN0eC5hY3Rpb24pXTtcbiAgICAgICAgICAgICAgICBjb25zdCBjb250ZXh0SGFzVHJhbnNtaXR0ZWRTdGF0dXMgPSBjdHguc3RhdHVzID09PSBzdGF0dXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhc2hNYXBIYXNUeXBlICYmIGNvbnRleHRIYXNUcmFuc21pdHRlZFN0YXR1cztcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgbWFwKCh7IGFjdGlvbiwgZXJyb3IgfTogQWN0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBnZXRBY3Rpb25UeXBlRnJvbUluc3RhbmNlKGFjdGlvbiksXG4gICAgICAgICAgICAgICAgcGF5bG9hZDogYWN0aW9uLnBheWxvYWQsXG4gICAgICAgICAgICAgICAgZXJyb3JcbiAgICAgICAgICAgIH0pKVxuICAgICAgICApO1xuICAgIH07XG59XG4iXX0= |
@@ -237,18 +237,18 @@ import { Injectable, Injector, NgModule, Self } from '@angular/core'; | ||
* | ||
* @param {?} emitters | ||
* @param {?} receivers - Array with references to the static functions | ||
* @return {?} - A key-value map where a key is a type and value is `true` | ||
*/ | ||
function getReceiverTypes(emitters) { | ||
function getReceiverTypes(receivers) { | ||
const /** @type {?} */ types = {}; | ||
let /** @type {?} */ i = emitters.length; | ||
let /** @type {?} */ i = receivers.length; | ||
while (i--) { | ||
const /** @type {?} */ emitter = emitters[i]; | ||
const /** @type {?} */ isNotFunction = typeof emitter !== 'function'; | ||
const /** @type {?} */ receiver = receivers[i]; | ||
const /** @type {?} */ isNotFunction = typeof receiver !== 'function'; | ||
if (isNotFunction) { | ||
throw new TypeError(`Emitter should be a function, got ${emitter}`); | ||
throw new TypeError(`Receiver should be a function, got ${receiver}`); | ||
} | ||
const /** @type {?} */ meta = emitter[RECEIVER_META_KEY]; | ||
const /** @type {?} */ meta = receiver[RECEIVER_META_KEY]; | ||
const /** @type {?} */ isNotAnnotated = !meta || !meta.type; | ||
if (isNotAnnotated) { | ||
throw new Error(`${emitter.name} should be decorated using @Receiver() decorator`); | ||
throw new Error(`${receiver.name} should be decorated using @Receiver() decorator`); | ||
} | ||
@@ -318,2 +318,2 @@ types[meta.type] = true; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4cy1jb250cmliLWVtaXR0ZXIuanMubWFwIiwic291cmNlcyI6WyJuZzovL0BuZ3hzLWNvbnRyaWIvZW1pdHRlci9saWIvY29yZS9pbnRlcm5hbC9pbnRlcm5hbHMudHMiLCJuZzovL0BuZ3hzLWNvbnRyaWIvZW1pdHRlci9saWIvY29yZS9kZWNvcmF0b3JzL3JlY2VpdmVyLnRzIiwibmc6Ly9Abmd4cy1jb250cmliL2VtaXR0ZXIvbGliL2NvcmUvc2VydmljZXMvaW5qZWN0b3ItYWNjZXNzb3Iuc2VydmljZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL2FjdGlvbnMvYWN0aW9ucy50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL3NlcnZpY2VzL2VtaXQtc3RvcmUuc2VydmljZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL2RlY29yYXRvcnMvZW1pdHRlci50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9lbWl0Lm1vZHVsZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL29wZXJhdG9ycy9vZi1lbWl0dGFibGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVHlwZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXB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5QixDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO1lBQ3BFLHVCQUFNLDJCQUEyQixHQUFHLEdBQUcsQ0FBQyxNQUFNLEtBQUssTUFBTSxDQUFDO1lBQzFELE9BQU8sY0FBYyxJQUFJLDJCQUEyQixDQUFDO1NBQ3hELENBQUMsRUFDRixHQUFHLENBQUMsQ0FBQyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQWlCLE1BQU07WUFDdkMsSUFBSSxFQUFFLHlCQUF5QixDQUFDLE1BQU0sQ0FBQztZQUN2QyxPQUFPLEVBQUUsTUFBTSxDQUFDLE9BQU87WUFDdkIsS0FBSztTQUNSLENBQUMsQ0FBQyxDQUNOLENBQUM7S0FDTCxDQUFDO0NBQ0w7Ozs7Ozs7Ozs7Ozs7OyJ9 |
@@ -255,18 +255,18 @@ import { Injectable, Injector, NgModule, Self } from '@angular/core'; | ||
* | ||
* @param {?} emitters | ||
* @param {?} receivers - Array with references to the static functions | ||
* @return {?} - A key-value map where a key is a type and value is `true` | ||
*/ | ||
function getReceiverTypes(emitters) { | ||
function getReceiverTypes(receivers) { | ||
var /** @type {?} */ types = {}; | ||
var /** @type {?} */ i = emitters.length; | ||
var /** @type {?} */ i = receivers.length; | ||
while (i--) { | ||
var /** @type {?} */ emitter = emitters[i]; | ||
var /** @type {?} */ isNotFunction = typeof emitter !== 'function'; | ||
var /** @type {?} */ receiver = receivers[i]; | ||
var /** @type {?} */ isNotFunction = typeof receiver !== 'function'; | ||
if (isNotFunction) { | ||
throw new TypeError("Emitter should be a function, got " + emitter); | ||
throw new TypeError("Receiver should be a function, got " + receiver); | ||
} | ||
var /** @type {?} */ meta = emitter[RECEIVER_META_KEY]; | ||
var /** @type {?} */ meta = receiver[RECEIVER_META_KEY]; | ||
var /** @type {?} */ isNotAnnotated = !meta || !meta.type; | ||
if (isNotAnnotated) { | ||
throw new Error(emitter.name + " should be decorated using @Receiver() decorator"); | ||
throw new Error(receiver.name + " should be decorated using @Receiver() decorator"); | ||
} | ||
@@ -355,2 +355,2 @@ types[meta.type] = true; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4cy1jb250cmliLWVtaXR0ZXIuanMubWFwIiwic291cmNlcyI6WyJuZzovL0BuZ3hzLWNvbnRyaWIvZW1pdHRlci9saWIvY29yZS9pbnRlcm5hbC9pbnRlcm5hbHMudHMiLCJuZzovL0BuZ3hzLWNvbnRyaWIvZW1pdHRlci9saWIvY29yZS9kZWNvcmF0b3JzL3JlY2VpdmVyLnRzIiwibmc6Ly9Abmd4cy1jb250cmliL2VtaXR0ZXIvbGliL2NvcmUvc2VydmljZXMvaW5qZWN0b3ItYWNjZXNzb3Iuc2VydmljZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL2FjdGlvbnMvYWN0aW9ucy50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL3NlcnZpY2VzL2VtaXQtc3RvcmUuc2VydmljZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL2RlY29yYXRvcnMvZW1pdHRlci50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9lbWl0Lm1vZHVsZS50cyIsIm5nOi8vQG5neHMtY29udHJpYi9lbWl0dGVyL2xpYi9jb3JlL29wZXJhdG9ycy9vZi1lbWl0dGFibGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVHlwZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBPYnNlcnZhYmxlIH0gZnJvbSAncnhqcyc7XG5cbi8qKlxuICogU3RhdHVzIG9mIGEgZGlzcGF0Y2hlZCBhY3Rpb25cbiAqL1xuZXhwb3J0IGNvbnN0IGVudW0gQWN0aW9uU3RhdHVzIHtcbiAgICBEaXNwYXRja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RCQUF3QixDQUFDO0NBQzFFOzs7OztBQUtEO0lBQW1DLG1CQUF3QjtTQUF4QixVQUF3QixFQUF4QixxQkFBd0IsRUFBeEIsSUFBd0I7UUFBeEIsOEJBQXdCOztJQUN2RCxPQUFPLFdBQVcsQ0FBQyxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsMEJBQXVCLENBQUM7Q0FDekU7Ozs7OztBQU9ELHFCQUE0QixLQUFZLEVBQUUsTUFBb0I7SUFDMUQsT0FBTyxVQUFDLE1BQWlDO1FBQ3JDLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FDZCxNQUFNLENBQUMsVUFBQyxHQUFrQjtZQUN0QixxQkFBTSxjQUFjLEdBQUcsS0FBSyxDQUFDLHlCQUF5QixDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO1lBQ3BFLHFCQUFNLDJCQUEyQixHQUFHLEdBQUcsQ0FBQyxNQUFNLEtBQUssTUFBTSxDQUFDO1lBQzFELE9BQU8sY0FBYyxJQUFJLDJCQUEyQixDQUFDO1NBQ3hELENBQUMsRUFDRixHQUFHLENBQUMsVUFBQyxFQUFnQztnQkFBOUIsa0JBQU0sRUFBRSxnQkFBSztZQUFzQixRQUFDO2dCQUN2QyxJQUFJLEVBQUUseUJBQXlCLENBQUMsTUFBTSxDQUFDO2dCQUN2QyxPQUFPLEVBQUUsTUFBTSxDQUFDLE9BQU87Z0JBQ3ZCLEtBQUssT0FBQTthQUNSO1NBQUMsQ0FBQyxDQUNOLENBQUM7S0FDTCxDQUFDO0NBQ0w7Ozs7Ozs7Ozs7Ozs7OyJ9 |
{ | ||
"name": "@ngxs-contrib/emitter", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^6.0.0-rc.0 || ^6.0.0", |
@@ -9,2 +9,4 @@ <p align="center"> | ||
[🚀 See it in action on Stackblitz](https://stackblitz.com/edit/ngxs-emitter-simple) | ||
This package allows you to get rid of actions. You can use decorators to register actions directly in your state, you don't have to create any actions in your project (until you really need them), as they don't give any profit, only bring extra boilerplate files. | ||
@@ -90,3 +92,3 @@ | ||
<h3>Count is {{ count.value }}</h3> | ||
<div class="add-counter"> | ||
<div> | ||
<button (click)="counterValue.emit(count.value + 1)">Increment (+1)</button> | ||
@@ -99,3 +101,3 @@ <button (click)="counterValue.emit(count.value - 1)">Decrement (-1)</button> | ||
export class CounterComponent { | ||
@Select((state) => state.counter) | ||
@Select(CounterState) | ||
public count$: Observable<CounterStateModel>; | ||
@@ -102,0 +104,0 @@ |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
311792
2174
215
0
1
1