New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ngxs/store

Package Overview
Dependencies
Maintainers
2
Versions
1361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngxs/store - npm Package Compare versions

Comparing version 2.1.0-dev.b006b94 to 2.1.0-dev.b28cfc7

2

bundles/ngxs-store.umd.js

@@ -187,3 +187,3 @@ (function (global, factory) {

}
else if (event.constructor.name) {
else if (event.constructor.name && event.constructor.name !== 'Object') {
return event.constructor.name;

@@ -190,0 +190,0 @@ }

@@ -1,2 +0,2 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("rxjs/operators"),require("rxjs/Observable"),require("rxjs/observable/fromPromise"),require("rxjs/observable/of"),require("rxjs/observable/forkJoin"),require("rxjs/Subject"),require("rxjs/BehaviorSubject"),require("rxjs/operators/map")):"function"==typeof define&&define.amd?define("@ngxs/store",["exports","@angular/core","rxjs/operators","rxjs/Observable","rxjs/observable/fromPromise","rxjs/observable/of","rxjs/observable/forkJoin","rxjs/Subject","rxjs/BehaviorSubject","rxjs/operators/map"],r):r((t.ngxs=t.ngxs||{},t.ngxs.store={}),t.ng.core,t.Rx.Observable.prototype,t.Rx,t.Rx.Observable,t.Rx.Observable,t.Rx.Observable,t.Rx,t.Rx,t.Rx.Observable.prototype)}(this,function(t,r,x,j,w,O,A,e,n,a){"use strict";var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])};function i(t,r){function e(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}function E(t){var r="function"==typeof Symbol&&t[Symbol.iterator],e=0;return r?r.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function u(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,o,a=e.call(t),i=[];try{for(;(void 0===r||0<r--)&&!(n=a.next()).done;)i.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(e=a["return"])&&e.call(a)}finally{if(o)throw o.error}}return i}function _(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(u(arguments[r]));return t}var c=new r.InjectionToken("ROOT_STATE_TOKEN"),s=new r.InjectionToken("FEATURE_STATE_TOKEN"),S="NGXS_META",f=new r.InjectionToken("NGXS_PLUGINS");function d(t){if(!t.hasOwnProperty(S)){Object.defineProperty(t,S,{value:{name:null,actions:{},defaults:{},path:null,children:[]}})}return t[S]}function p(t){for(var r=t,e="store."+r[0],n=0,o=r.length,a=e;++n<o;)a=a+" && "+(e=e+"."+r[n]);return new Function("store","return "+a+";")}function P(t){return t.constructor.type?t.constructor.type:t.constructor.name?t.constructor.name:t.type?t.type:void 0}var l=function(t,r,e){t=Object.assign({},t);var n=r.split("."),o=n[n.length-1];return n.reduce(function(t,r){return t[r]=r===o?e:Object.assign({},t[r]),t&&t[r]},t),t},y=function(t,r){return r.split(".").reduce(function(t,r){return t&&t[r]},t)};function I(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e={};return t.forEach(function(t){e[t.type||t.name]=!0}),x.filter(function(t){return e[t.constructor.type||t.constructor.name]})}var h=function(){function t(t,r){this._injector=t,this._parentFactory=r,this._states=[]}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),t.prototype.add=function(t){Array.isArray(t)||(t=[t]);var e,a,n,o,i,u,r,c,s,f=(a=function(r){var t=e.find(function(t){return t===r});if(!t)throw new Error("Child state not found: "+r);if(!t[S])throw new Error("States must be decorated with @State() decorator");return t[S].name},(e=t).reduce(function(t,r){if(!r[S])throw new Error("States must be decorated with @State() decorator");var e=r[S],n=e.name,o=e.children;return t[n]=(o||[]).map(a),t},{})),p=(n=f,o=[],i={},u=function(r,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(r),i[r]=!0,n[r].forEach(function(t){if(0<=e.indexOf(t))throw new Error("Circular dependency '"+t+"' is required by '"+r+"': "+e.join(" -> "));i[t]||u(t,e.slice(0))}),o.indexOf(r)<0&&o.push(r)},Object.keys(n).forEach(function(t){return u(t)}),o.reverse()),l=function(t,r){void 0===r&&(r={});var o=function(t,r){for(var e in t)if(t.hasOwnProperty(e)&&0<=t[e].indexOf(r)){var n=o(t,e);return null!==n?n+"."+e:e}return null};for(var e in t)if(t.hasOwnProperty(e)){var n=o(t,e);r[e]=n?n+"."+e:e}return r}(f),y=t.reduce(function(t,r){if(!r[S])throw new Error("States must be decorated with @State() decorator");return t[r[S].name]=r,t},{}),d=[],h=function(r){var t=y[r];if(!t[S])throw new Error("States must be decorated with @State() decorator");var e,n=l[r],o=t[S].actions,a=t[S].defaults;if(t[S].path=n,v.states.find(function(t){return t.name===r}))throw new Error("Store has already been added: "+r);Array.isArray(a)?a=_(a):"object"==typeof(e=a)&&null!==e||"function"==typeof e?a=Object.assign({},a):a===undefined&&(a={});var i=v._injector.get(t);d.push({actions:o,instance:i,defaults:a,name:r,depth:n})},v=this;try{for(var b=E(p),g=b.next();!g.done;g=b.next()){h(g.value)}}catch(m){r={error:m}}finally{try{g&&!g.done&&(c=b["return"])&&c.call(b)}finally{if(r)throw r.error}}return(s=this.states).push.apply(s,_(d)),d},t.prototype.addAndReturnDefaults=function(t){if(t){var r=this.add(t);return{defaults:r.reduce(function(t,r){return l(t,r.depth,r.defaults)},{}),states:r}}},t.prototype.invokeInit=function(t,r,e,n){try{for(var o=E(n),a=o.next();!a.done;a=o.next()){var i=a.value;if(i.instance.onInit){var u=this.createStateContext(t,r,e,i);i.instance.onInit(u)}}}catch(f){c={error:f}}finally{try{a&&!a.done&&(s=o["return"])&&s.call(o)}finally{if(c)throw c.error}}var c,s},t.prototype.invokeActions=function(t,r,e,n,o){var a,i,u,c,s=[];try{for(var f=E(this.states),p=f.next();!p.done;p=f.next()){var l=p.value,y=P(o),d=l.actions[y];if(d)try{for(var h=E(d),v=h.next();!v.done;v=h.next()){var b=v.value,g=this.createStateContext(t,r,e,l),m=l.instance[b.fn](g,o);m===undefined?m=O.of({}).pipe(x.shareReplay()):m instanceof Promise&&(m=w.fromPromise(m)),m instanceof j.Observable&&(m=m.pipe(b.options.takeLast?x.takeUntil(n.pipe(I(o.constructor))):x.map(function(t){return t}))),s.push(m)}}catch(_){u={error:_}}finally{try{v&&!v.done&&(c=h["return"])&&c.call(h)}finally{if(u)throw u.error}}}}catch(S){a={error:S}}finally{try{p&&!p.done&&(i=f["return"])&&i.call(f)}finally{if(a)throw a.error}}return A.forkJoin(s)},t.prototype.createStateContext=function(o,a,r,i){return{getState:function(){var t=o();return y(t,i.depth)},patchState:function(t){if(Array.isArray(t))throw new Error("Patching arrays is not supported.");var r=o(),e=y(r,i.depth);for(var n in t)e[n]=t[n];return r=l(r,i.depth,Object.assign({},e)),a(r),r},setState:function(t){var r=o();return r=l(r,i.depth,t),a(r),r},dispatch:function(t){return r(t)}}},t}();h.decorators=[{type:r.Injectable}],h.ctorParameters=function(){return[{type:r.Injector},{type:h,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var v=function(e){function t(t){var r=e.call(this)||this;return t&&Object.assign(r,t),r}return i(t,e),t}(e.Subject);v.decorators=[{type:r.Injectable}],v.ctorParameters=function(){return[{type:v,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var b=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.shift().apply(void 0,_(t,[function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return b(e).apply(void 0,_(t))}]))}},g=function(e){function t(t){var r=e.call(this,{})||this;return t&&Object.assign(r,t),r}return i(t,e),t}(n.BehaviorSubject);g.decorators=[{type:r.Injectable}],g.ctorParameters=function(){return[{type:g,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var m=function(){function t(t,r){this._parentManager=t,this._plugins=r,this.plugins=[],this.register()}return t.prototype.register=function(){var t;this._plugins&&(this.plugins=this._plugins.map(function(t){return t.handle?t.handle.bind(t):t}),this._parentManager&&(t=this._parentManager.plugins).push.apply(t,_(this.plugins)))},t}();m.decorators=[{type:r.Injectable}],m.ctorParameters=function(){return[{type:m,decorators:[{type:r.Optional},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Inject,args:[f]},{type:r.Optional}]}]};var k=function(){function t(t,r,e,n,o){this._errorHandler=t,this._actions=r,this._storeFactory=e,this._pluginManager=n,this._stateStream=o}return t.prototype.dispatch=function(t){var r,e=this;return(r=Array.isArray(t)?A.forkJoin(t.map(function(t){return e._dispatch(t)})):this._dispatch(t)).pipe(x.catchError(function(t){return e._errorHandler.handleError(t),O.of(t)})),r.subscribe(),r},t.prototype.select=function(t){if(t[S]&&t[S].path){var r=p(t[S].path.split("."));return this._stateStream.pipe(a.map(r),x.distinctUntilChanged())}return this._stateStream.pipe(a.map(t),x.catchError(function(t){if(t instanceof TypeError)return O.of(undefined);throw t}),x.distinctUntilChanged())},t.prototype.selectOnce=function(t){return this.select(t).pipe(x.take(1))},t.prototype.selectSnapshot=function(t){return t(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.subscribe(t)},t.prototype.snapshot=function(){return this._stateStream.getValue()},t.prototype._dispatch=function(e){var n=this,o=this._stateStream.getValue(),t=this._pluginManager.plugins;return b(_(t,[function(t,r){return t!==o&&n._stateStream.next(t),n._actions.next(r),n._storeFactory.invokeActions(function(){return n._stateStream.getValue()},function(t){return n._stateStream.next(t)},function(t){return n.dispatch(t)},n._actions,e).pipe(a.map(function(){return n._stateStream.getValue()}))}]))(o,e).pipe(x.shareReplay())},t}();k.decorators=[{type:r.Injectable}],k.ctorParameters=function(){return[{type:r.ErrorHandler},{type:v},{type:h},{type:m},{type:g}]};var T=function(t){};T.store=undefined,T.decorators=[{type:r.Injectable}],T.ctorParameters=function(){return[{type:k}]};var R=function(){};R.type="@@INIT";var M=function(){};M.type="@@UPDATE_STATE";var V=function(t,r,e,n,o){var a=t.addAndReturnDefaults(o);if(a){var i=r.getValue();r.next(Object.assign({},i,a.defaults))}e.dispatch(new R),a&&t.invokeInit(function(){return r.getValue()},function(t){return r.next(t)},function(t){return e.dispatch(t)},a.states)};V.decorators=[{type:r.NgModule}],V.ctorParameters=function(){return[{type:h},{type:g},{type:k},{type:T},{type:Array,decorators:[{type:r.Optional},{type:r.Inject,args:[c]}]}]};var N=function(r,e,t,n){var o=[].concat.apply([],_(n)),a=t.addAndReturnDefaults(o);if(a){var i=e.getValue();e.next(Object.assign({},i,a.defaults))}r.dispatch(new M),a&&t.invokeInit(function(){return e.getValue()},function(t){return e.next(t)},function(t){return r.dispatch(t)},a.states)};N.decorators=[{type:r.NgModule,args:[{}]}],N.ctorParameters=function(){return[{type:k},{type:g},{type:h},{type:Array,decorators:[{type:r.Optional},{type:r.Inject,args:[s]}]}]};var q=function(){function t(){}return t.forRoot=function(t){return void 0===t&&(t=[]),{ngModule:V,providers:_([h,v,k,g,T,m],t,[{provide:c,useValue:t}])}},t.forFeature=function(t){return{ngModule:N,providers:_([h,m],t,[{provide:s,multi:!0,useValue:t}])}},t}();q.decorators=[{type:r.NgModule,args:[{}]}],q.ctorParameters=function(){return[]},t.NgxsModule=q,t.Action=function(l,y){return function(t,r,e){var n,o,a,i=d(t.constructor);Array.isArray(l)||(l=[l]);try{for(var u=E(l),c=u.next();!c.done;c=u.next()){var s=c.value,f=(n=s).type?n.type:n.name?n.name:void 0;i.actions[f]||(i.actions[f]=[]),i.actions[f].push({fn:r,options:y||{},type:f})}}catch(p){o={error:p}}finally{try{c&&!c.done&&(a=u["return"])&&a.call(u)}finally{if(o)throw o.error}}}},t.Store=k,t.State=function(n){return function(t){var r=d(t);if(t.__proto__.hasOwnProperty(S)){var e=t.__proto__[S];r.actions=Object.assign({},r.actions,e.actions)}if(r.children=n.children,r.defaults=n.defaults,r.name=n.name,!n.name)throw new Error("States must register a 'name' property")}},t.Select=function(n){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(t,r){var e="__"+r+"__selector";if(n||(n=r.lastIndexOf("$")===r.length-1?r.substring(0,r.length-1):r),t[e])throw new Error("You cannot use @Select decorator and a "+e+" property.");delete t[r]&&(Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,r,{get:function(){return this[e]||(this[e]=function(t){var r=T.store;if(!r)throw new Error("SelectFactory not connected to store!");return r.select(t)}.apply(this,["string"==typeof n?p(o.length?_([n],o):n.split(".")):n[S]&&n[S].path?p(n[S].path.split(".")):n]))},enumerable:!0,configurable:!0}))}},t.Actions=v,t.ofAction=I,t.Selector=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return function(t,r,e){var n=d(t);if(null!==e.value){var o=e.value,a=function(t){var r=y(t,n.path);try{return o(r)}catch(e){if(e instanceof TypeError)return undefined;throw e}};return{configurable:!0,get:function(){return function(a,i){var u=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=i?i.apply(this,t):t[0],n=u.cache;if(n.has(e))return n.get(e);var o=a.apply(this,t);return u.cache=n.set(e,o)||n,o};return u.cache=new WeakMap,u}.apply(null,_([a],i))}}}throw new Error("Selectors only work on methods")}},t.getActionTypeFromInstance=P,t.NGXS_PLUGINS=f,t.StateStream=g,t.setValue=l,t.getValue=y,t.InitState=R,t.UpdateState=M,t.ɵb=N,t.ɵa=V,t.ɵg=m,t.ɵc=T,t.ɵf=h,t.ɵe=s,t.ɵd=c,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("rxjs/operators"),require("rxjs/Observable"),require("rxjs/observable/fromPromise"),require("rxjs/observable/of"),require("rxjs/observable/forkJoin"),require("rxjs/Subject"),require("rxjs/BehaviorSubject"),require("rxjs/operators/map")):"function"==typeof define&&define.amd?define("@ngxs/store",["exports","@angular/core","rxjs/operators","rxjs/Observable","rxjs/observable/fromPromise","rxjs/observable/of","rxjs/observable/forkJoin","rxjs/Subject","rxjs/BehaviorSubject","rxjs/operators/map"],r):r((t.ngxs=t.ngxs||{},t.ngxs.store={}),t.ng.core,t.Rx.Observable.prototype,t.Rx,t.Rx.Observable,t.Rx.Observable,t.Rx.Observable,t.Rx,t.Rx,t.Rx.Observable.prototype)}(this,function(t,r,j,x,w,O,A,e,n,a){"use strict";var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])};function i(t,r){function e(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}function E(t){var r="function"==typeof Symbol&&t[Symbol.iterator],e=0;return r?r.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function u(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,o,a=e.call(t),i=[];try{for(;(void 0===r||0<r--)&&!(n=a.next()).done;)i.push(n.value)}catch(u){o={error:u}}finally{try{n&&!n.done&&(e=a["return"])&&e.call(a)}finally{if(o)throw o.error}}return i}function _(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(u(arguments[r]));return t}var c=new r.InjectionToken("ROOT_STATE_TOKEN"),s=new r.InjectionToken("FEATURE_STATE_TOKEN"),S="NGXS_META",f=new r.InjectionToken("NGXS_PLUGINS");function d(t){if(!t.hasOwnProperty(S)){Object.defineProperty(t,S,{value:{name:null,actions:{},defaults:{},path:null,children:[]}})}return t[S]}function p(t){for(var r=t,e="store."+r[0],n=0,o=r.length,a=e;++n<o;)a=a+" && "+(e=e+"."+r[n]);return new Function("store","return "+a+";")}function P(t){return t.constructor.type?t.constructor.type:t.constructor.name&&"Object"!==t.constructor.name?t.constructor.name:t.type?t.type:void 0}var l=function(t,r,e){t=Object.assign({},t);var n=r.split("."),o=n[n.length-1];return n.reduce(function(t,r){return t[r]=r===o?e:Object.assign({},t[r]),t&&t[r]},t),t},y=function(t,r){return r.split(".").reduce(function(t,r){return t&&t[r]},t)};function I(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e={};return t.forEach(function(t){e[t.type||t.name]=!0}),j.filter(function(t){return e[t.constructor.type||t.constructor.name]})}var h=function(){function t(t,r){this._injector=t,this._parentFactory=r,this._states=[]}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),t.prototype.add=function(t){Array.isArray(t)||(t=[t]);var e,a,n,o,i,u,r,c,s,f=(a=function(r){var t=e.find(function(t){return t===r});if(!t)throw new Error("Child state not found: "+r);if(!t[S])throw new Error("States must be decorated with @State() decorator");return t[S].name},(e=t).reduce(function(t,r){if(!r[S])throw new Error("States must be decorated with @State() decorator");var e=r[S],n=e.name,o=e.children;return t[n]=(o||[]).map(a),t},{})),p=(n=f,o=[],i={},u=function(r,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(r),i[r]=!0,n[r].forEach(function(t){if(0<=e.indexOf(t))throw new Error("Circular dependency '"+t+"' is required by '"+r+"': "+e.join(" -> "));i[t]||u(t,e.slice(0))}),o.indexOf(r)<0&&o.push(r)},Object.keys(n).forEach(function(t){return u(t)}),o.reverse()),l=function(t,r){void 0===r&&(r={});var o=function(t,r){for(var e in t)if(t.hasOwnProperty(e)&&0<=t[e].indexOf(r)){var n=o(t,e);return null!==n?n+"."+e:e}return null};for(var e in t)if(t.hasOwnProperty(e)){var n=o(t,e);r[e]=n?n+"."+e:e}return r}(f),y=t.reduce(function(t,r){if(!r[S])throw new Error("States must be decorated with @State() decorator");return t[r[S].name]=r,t},{}),d=[],h=function(r){var t=y[r];if(!t[S])throw new Error("States must be decorated with @State() decorator");var e,n=l[r],o=t[S].actions,a=t[S].defaults;if(t[S].path=n,v.states.find(function(t){return t.name===r}))throw new Error("Store has already been added: "+r);Array.isArray(a)?a=_(a):"object"==typeof(e=a)&&null!==e||"function"==typeof e?a=Object.assign({},a):a===undefined&&(a={});var i=v._injector.get(t);d.push({actions:o,instance:i,defaults:a,name:r,depth:n})},v=this;try{for(var b=E(p),g=b.next();!g.done;g=b.next()){h(g.value)}}catch(m){r={error:m}}finally{try{g&&!g.done&&(c=b["return"])&&c.call(b)}finally{if(r)throw r.error}}return(s=this.states).push.apply(s,_(d)),d},t.prototype.addAndReturnDefaults=function(t){if(t){var r=this.add(t);return{defaults:r.reduce(function(t,r){return l(t,r.depth,r.defaults)},{}),states:r}}},t.prototype.invokeInit=function(t,r,e,n){try{for(var o=E(n),a=o.next();!a.done;a=o.next()){var i=a.value;if(i.instance.onInit){var u=this.createStateContext(t,r,e,i);i.instance.onInit(u)}}}catch(f){c={error:f}}finally{try{a&&!a.done&&(s=o["return"])&&s.call(o)}finally{if(c)throw c.error}}var c,s},t.prototype.invokeActions=function(t,r,e,n,o){var a,i,u,c,s=[];try{for(var f=E(this.states),p=f.next();!p.done;p=f.next()){var l=p.value,y=P(o),d=l.actions[y];if(d)try{for(var h=E(d),v=h.next();!v.done;v=h.next()){var b=v.value,g=this.createStateContext(t,r,e,l),m=l.instance[b.fn](g,o);m===undefined?m=O.of({}).pipe(j.shareReplay()):m instanceof Promise&&(m=w.fromPromise(m)),m instanceof x.Observable&&(m=m.pipe(b.options.takeLast?j.takeUntil(n.pipe(I(o.constructor))):j.map(function(t){return t}))),s.push(m)}}catch(_){u={error:_}}finally{try{v&&!v.done&&(c=h["return"])&&c.call(h)}finally{if(u)throw u.error}}}}catch(S){a={error:S}}finally{try{p&&!p.done&&(i=f["return"])&&i.call(f)}finally{if(a)throw a.error}}return A.forkJoin(s)},t.prototype.createStateContext=function(o,a,r,i){return{getState:function(){var t=o();return y(t,i.depth)},patchState:function(t){if(Array.isArray(t))throw new Error("Patching arrays is not supported.");var r=o(),e=y(r,i.depth);for(var n in t)e[n]=t[n];return r=l(r,i.depth,Object.assign({},e)),a(r),r},setState:function(t){var r=o();return r=l(r,i.depth,t),a(r),r},dispatch:function(t){return r(t)}}},t}();h.decorators=[{type:r.Injectable}],h.ctorParameters=function(){return[{type:r.Injector},{type:h,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var v=function(e){function t(t){var r=e.call(this)||this;return t&&Object.assign(r,t),r}return i(t,e),t}(e.Subject);v.decorators=[{type:r.Injectable}],v.ctorParameters=function(){return[{type:v,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var b=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.shift().apply(void 0,_(t,[function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return b(e).apply(void 0,_(t))}]))}},g=function(e){function t(t){var r=e.call(this,{})||this;return t&&Object.assign(r,t),r}return i(t,e),t}(n.BehaviorSubject);g.decorators=[{type:r.Injectable}],g.ctorParameters=function(){return[{type:g,decorators:[{type:r.Optional},{type:r.SkipSelf}]}]};var m=function(){function t(t,r){this._parentManager=t,this._plugins=r,this.plugins=[],this.register()}return t.prototype.register=function(){var t;this._plugins&&(this.plugins=this._plugins.map(function(t){return t.handle?t.handle.bind(t):t}),this._parentManager&&(t=this._parentManager.plugins).push.apply(t,_(this.plugins)))},t}();m.decorators=[{type:r.Injectable}],m.ctorParameters=function(){return[{type:m,decorators:[{type:r.Optional},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Inject,args:[f]},{type:r.Optional}]}]};var k=function(){function t(t,r,e,n,o){this._errorHandler=t,this._actions=r,this._storeFactory=e,this._pluginManager=n,this._stateStream=o}return t.prototype.dispatch=function(t){var r,e=this;return(r=Array.isArray(t)?A.forkJoin(t.map(function(t){return e._dispatch(t)})):this._dispatch(t)).pipe(j.catchError(function(t){return e._errorHandler.handleError(t),O.of(t)})),r.subscribe(),r},t.prototype.select=function(t){if(t[S]&&t[S].path){var r=p(t[S].path.split("."));return this._stateStream.pipe(a.map(r),j.distinctUntilChanged())}return this._stateStream.pipe(a.map(t),j.catchError(function(t){if(t instanceof TypeError)return O.of(undefined);throw t}),j.distinctUntilChanged())},t.prototype.selectOnce=function(t){return this.select(t).pipe(j.take(1))},t.prototype.selectSnapshot=function(t){return t(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.subscribe(t)},t.prototype.snapshot=function(){return this._stateStream.getValue()},t.prototype._dispatch=function(e){var n=this,o=this._stateStream.getValue(),t=this._pluginManager.plugins;return b(_(t,[function(t,r){return t!==o&&n._stateStream.next(t),n._actions.next(r),n._storeFactory.invokeActions(function(){return n._stateStream.getValue()},function(t){return n._stateStream.next(t)},function(t){return n.dispatch(t)},n._actions,e).pipe(a.map(function(){return n._stateStream.getValue()}))}]))(o,e).pipe(j.shareReplay())},t}();k.decorators=[{type:r.Injectable}],k.ctorParameters=function(){return[{type:r.ErrorHandler},{type:v},{type:h},{type:m},{type:g}]};var T=function(t){};T.store=undefined,T.decorators=[{type:r.Injectable}],T.ctorParameters=function(){return[{type:k}]};var R=function(){};R.type="@@INIT";var M=function(){};M.type="@@UPDATE_STATE";var V=function(t,r,e,n,o){var a=t.addAndReturnDefaults(o);if(a){var i=r.getValue();r.next(Object.assign({},i,a.defaults))}e.dispatch(new R),a&&t.invokeInit(function(){return r.getValue()},function(t){return r.next(t)},function(t){return e.dispatch(t)},a.states)};V.decorators=[{type:r.NgModule}],V.ctorParameters=function(){return[{type:h},{type:g},{type:k},{type:T},{type:Array,decorators:[{type:r.Optional},{type:r.Inject,args:[c]}]}]};var N=function(r,e,t,n){var o=[].concat.apply([],_(n)),a=t.addAndReturnDefaults(o);if(a){var i=e.getValue();e.next(Object.assign({},i,a.defaults))}r.dispatch(new M),a&&t.invokeInit(function(){return e.getValue()},function(t){return e.next(t)},function(t){return r.dispatch(t)},a.states)};N.decorators=[{type:r.NgModule,args:[{}]}],N.ctorParameters=function(){return[{type:k},{type:g},{type:h},{type:Array,decorators:[{type:r.Optional},{type:r.Inject,args:[s]}]}]};var q=function(){function t(){}return t.forRoot=function(t){return void 0===t&&(t=[]),{ngModule:V,providers:_([h,v,k,g,T,m],t,[{provide:c,useValue:t}])}},t.forFeature=function(t){return{ngModule:N,providers:_([h,m],t,[{provide:s,multi:!0,useValue:t}])}},t}();q.decorators=[{type:r.NgModule,args:[{}]}],q.ctorParameters=function(){return[]},t.NgxsModule=q,t.Action=function(l,y){return function(t,r,e){var n,o,a,i=d(t.constructor);Array.isArray(l)||(l=[l]);try{for(var u=E(l),c=u.next();!c.done;c=u.next()){var s=c.value,f=(n=s).type?n.type:n.name?n.name:void 0;i.actions[f]||(i.actions[f]=[]),i.actions[f].push({fn:r,options:y||{},type:f})}}catch(p){o={error:p}}finally{try{c&&!c.done&&(a=u["return"])&&a.call(u)}finally{if(o)throw o.error}}}},t.Store=k,t.State=function(n){return function(t){var r=d(t);if(t.__proto__.hasOwnProperty(S)){var e=t.__proto__[S];r.actions=Object.assign({},r.actions,e.actions)}if(r.children=n.children,r.defaults=n.defaults,r.name=n.name,!n.name)throw new Error("States must register a 'name' property")}},t.Select=function(n){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(t,r){var e="__"+r+"__selector";if(n||(n=r.lastIndexOf("$")===r.length-1?r.substring(0,r.length-1):r),t[e])throw new Error("You cannot use @Select decorator and a "+e+" property.");delete t[r]&&(Object.defineProperty(t,e,{writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,r,{get:function(){return this[e]||(this[e]=function(t){var r=T.store;if(!r)throw new Error("SelectFactory not connected to store!");return r.select(t)}.apply(this,["string"==typeof n?p(o.length?_([n],o):n.split(".")):n[S]&&n[S].path?p(n[S].path.split(".")):n]))},enumerable:!0,configurable:!0}))}},t.Actions=v,t.ofAction=I,t.Selector=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return function(t,r,e){var n=d(t);if(null!==e.value){var o=e.value,a=function(t){var r=y(t,n.path);try{return o(r)}catch(e){if(e instanceof TypeError)return undefined;throw e}};return{configurable:!0,get:function(){return function(a,i){var u=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=i?i.apply(this,t):t[0],n=u.cache;if(n.has(e))return n.get(e);var o=a.apply(this,t);return u.cache=n.set(e,o)||n,o};return u.cache=new WeakMap,u}.apply(null,_([a],i))}}}throw new Error("Selectors only work on methods")}},t.getActionTypeFromInstance=P,t.NGXS_PLUGINS=f,t.StateStream=g,t.setValue=l,t.getValue=y,t.InitState=R,t.UpdateState=M,t.ɵb=N,t.ɵa=V,t.ɵg=m,t.ɵc=T,t.ɵf=h,t.ɵe=s,t.ɵd=c,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ngxs-store.umd.min.js.map

@@ -262,3 +262,3 @@ import { InjectionToken, Injector, Injectable, SkipSelf, Optional, Inject, ErrorHandler, NgModule } from '@angular/core';

}
else if (event.constructor.name) {
else if (event.constructor.name && event.constructor.name !== 'Object') {
return event.constructor.name;

@@ -265,0 +265,0 @@ }

@@ -131,3 +131,3 @@ import { __spread, __values, __extends } from 'tslib';

}
else if (event.constructor.name) {
else if (event.constructor.name && event.constructor.name !== 'Object') {
return event.constructor.name;

@@ -134,0 +134,0 @@ }

{
"name": "@ngxs/store",
"version": "2.1.0-dev.b006b94",
"version": "2.1.0-dev.b28cfc7",
"license": "MIT",

@@ -5,0 +5,0 @@ "peerDependencies": {

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

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