ngx-error-boundary
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -221,5 +221,8 @@ (function (global, factory) { | ||
var GLOBAL_KEY = new core.InjectionToken("global_key"); | ||
var NgxErrorBoundaryService = /** @class */ (function () { | ||
function NgxErrorBoundaryService() { | ||
function NgxErrorBoundaryService(token) { | ||
var _this = this; | ||
this.token = token; | ||
this.errorStore = {}; | ||
@@ -240,4 +243,6 @@ this.keyStore = {}; | ||
var _a, _b; | ||
if (key === void 0) { key = "_$ngx_error_boundary_global_error$_"; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, _a[key] = errors, _a)); | ||
if (key === void 0) { key = this.token; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, | ||
_a[key] = errors, | ||
_a)); | ||
this.keyStore = Object.assign({}, this.keyStore, (_b = {}, _b[key] = true, _b)); | ||
@@ -291,4 +296,8 @@ this.errorsSubject.next(this.errorStore); | ||
}; | ||
NgxErrorBoundaryService.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: core.Inject, args: [GLOBAL_KEY,] }] } | ||
]; }; | ||
NgxErrorBoundaryService = __decorate([ | ||
core.Injectable() | ||
core.Injectable(), | ||
__param(0, core.Inject(GLOBAL_KEY)) | ||
], NgxErrorBoundaryService); | ||
@@ -417,2 +426,8 @@ return NgxErrorBoundaryService; | ||
schemas: [core.CUSTOM_ELEMENTS_SCHEMA], | ||
providers: [ | ||
{ | ||
provide: GLOBAL_KEY, | ||
useValue: "_$ngx_error_boundary_global_error$_", | ||
}, | ||
], | ||
}) | ||
@@ -428,2 +443,3 @@ ], NgxErrorBoundaryModule); | ||
exports.NgxErrorRetryDirective = NgxErrorRetryDirective; | ||
exports.ɵa = GLOBAL_KEY; | ||
@@ -430,0 +446,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -15,3 +15,3 @@ !function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-error-boundary",["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],e):e((r=r||self)["ngx-error-boundary"]={},r.ng.core,r.rxjs,r.rxjs.operators,r.ng.common)}(this,(function(r,e,t,n,o){"use strict"; | ||
and limitations under the License. | ||
***************************************************************************** */var i=function(){return(i=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)};function s(r,e,t,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function c(r,e){var t="function"==typeof Symbol&&r[Symbol.iterator];if(!t)return r;var n,o,i=t.call(r),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}var u=function(){function r(){var r=this;this.errorStore={},this.keyStore={},this.errorsSubject=new t.BehaviorSubject({}),this.keySubject=new t.BehaviorSubject({}),this.retryStatusSubjet=new t.BehaviorSubject("end"),this.retryStatus$=this.retryStatusSubjet.asObservable(),this.retryClickSubject=new t.Subject,this.retryClick$=this.retryClickSubject.asObservable().pipe(n.tap((function(){r.retryStatusSubjet.next("start")}))),this.errors$=this.errorsSubject.asObservable().pipe(n.filter((function(r){return!!r}))),this.keys$=this.keySubject.asObservable().pipe(n.filter((function(r){return!!r})))}return r.prototype.showErrors=function(r,e){var t,n;void 0===e&&(e="_$ngx_error_boundary_global_error$_"),this.errorStore=Object.assign({},this.errorStore,((t={})[e]=r,t)),this.keyStore=Object.assign({},this.keyStore,((n={})[e]=!0,n)),this.errorsSubject.next(this.errorStore),this.keySubject.next(this.keyStore)},r.prototype.handleExpection=function(r){var e=this;void 0===r&&(r={});var o=r.message,i=r.key;return function(r){return new t.Observable((function(s){var c=r.pipe(n.catchError((function(r){e.retryStatusSubjet.next("end");var n=o||JSON.stringify(r);return e.showErrors(n,i),t.throwError(r)})),n.retryWhen((function(r){return r.pipe(n.exhaustMap((function(){return e.retryClick$})),n.delay(10))})),n.tap((function(r){e.dismiss(i)}))).subscribe(s);return function(){c.unsubscribe()}}))}},r.prototype.dismiss=function(r){r||(this.errorStore={},this.keyStore={},this.errorsSubject.next({}),this.keySubject.next({})),delete this.errorStore[r],delete this.keyStore[r],this.errorsSubject.next(this.errorStore),this.keySubject.next(this.keyStore)},r.prototype.doRetry=function(){this.retryClickSubject.next()},r=s([e.Injectable()],r)}(),a=function(){function r(r){this.errorService=r,this.key="_$ngx_error_boundary_global_error$_"}return r.prototype.ngOnInit=function(){var r=this;this.errors$=t.combineLatest([this.errorService.errors$,this.errorService.keys$]).pipe(n.map((function(e){var t=c(e,2),n=t[0],o=t[1];return r.zip(n,o)}))),this.isRetrying$=this.errorService.retryStatus$.pipe(n.map((function(r){return"end"!==r})))},r.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},r.prototype.zip=function(r,e){return Object.keys(e).reduce((function(e,t){var n;return i(i({},e),((n={})[t]=r[t],n))}),{})},r.prototype.getContext=function(r,e){return{$implicit:{message:r,key:e},retry$:this.isRetrying$}},r.ctorParameters=function(){return[{type:u}]},s([e.Input()],r.prototype,"fallback",void 0),s([e.Input()],r.prototype,"key",void 0),r=s([e.Component({selector:"ErrorBoundary",template:'<ng-container *ngIf="errors$ | async as errors; else content">\n <ng-container *ngIf="errors[key] as error; else content">\n <ng-container\n [ngTemplateOutlet]="fallback"\n [ngTemplateOutletContext]="getContext(error, key)"\n >\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n'})],r)}(),p=function(){function r(r){this.errorService=r}return r.prototype.onClick=function(){this.errorService.doRetry()},r.prototype.ngOnInit=function(){},r.ctorParameters=function(){return[{type:u}]},s([e.HostListener("click")],r.prototype,"onClick",null),r=s([e.Directive({selector:"[errorRetry]",exportAs:"retry"})],r)}(),y=function(){function r(r){this.errorService=r}return r.prototype.onClick=function(){this.errorService.dismiss(this.errorDismiss)},r.ctorParameters=function(){return[{type:u}]},s([e.Input()],r.prototype,"errorDismiss",void 0),s([e.HostListener("click")],r.prototype,"onClick",null),r=s([e.Directive({selector:"[errorDismiss]",exportAs:"dismiss"})],r)}(),l=function(){function r(){}return r=s([e.NgModule({declarations:[a,p,y],imports:[o.CommonModule],exports:[a,p,y],schemas:[e.CUSTOM_ELEMENTS_SCHEMA]})],r)}();r.NgxErrorBoundaryComponent=a,r.NgxErrorBoundaryModule=l,r.NgxErrorBoundaryService=u,r.NgxErrorDismissDirective=y,r.NgxErrorRetryDirective=p,Object.defineProperty(r,"__esModule",{value:!0})})); | ||
***************************************************************************** */var i=function(){return(i=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)};function s(r,e,t,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function c(r,e){var t="function"==typeof Symbol&&r[Symbol.iterator];if(!t)return r;var n,o,i=t.call(r),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(r){o={error:r}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}var u=new e.InjectionToken("global_key"),a=function(){function r(r){var e=this;this.token=r,this.errorStore={},this.keyStore={},this.errorsSubject=new t.BehaviorSubject({}),this.keySubject=new t.BehaviorSubject({}),this.retryStatusSubjet=new t.BehaviorSubject("end"),this.retryStatus$=this.retryStatusSubjet.asObservable(),this.retryClickSubject=new t.Subject,this.retryClick$=this.retryClickSubject.asObservable().pipe(n.tap((function(){e.retryStatusSubjet.next("start")}))),this.errors$=this.errorsSubject.asObservable().pipe(n.filter((function(r){return!!r}))),this.keys$=this.keySubject.asObservable().pipe(n.filter((function(r){return!!r})))}var o,i;return r.prototype.showErrors=function(r,e){var t,n;void 0===e&&(e=this.token),this.errorStore=Object.assign({},this.errorStore,((t={})[e]=r,t)),this.keyStore=Object.assign({},this.keyStore,((n={})[e]=!0,n)),this.errorsSubject.next(this.errorStore),this.keySubject.next(this.keyStore)},r.prototype.handleExpection=function(r){var e=this;void 0===r&&(r={});var o=r.message,i=r.key;return function(r){return new t.Observable((function(s){var c=r.pipe(n.catchError((function(r){e.retryStatusSubjet.next("end");var n=o||JSON.stringify(r);return e.showErrors(n,i),t.throwError(r)})),n.retryWhen((function(r){return r.pipe(n.exhaustMap((function(){return e.retryClick$})),n.delay(10))})),n.tap((function(r){e.dismiss(i)}))).subscribe(s);return function(){c.unsubscribe()}}))}},r.prototype.dismiss=function(r){r||(this.errorStore={},this.keyStore={},this.errorsSubject.next({}),this.keySubject.next({})),delete this.errorStore[r],delete this.keyStore[r],this.errorsSubject.next(this.errorStore),this.keySubject.next(this.keyStore)},r.prototype.doRetry=function(){this.retryClickSubject.next()},r.ctorParameters=function(){return[{type:String,decorators:[{type:e.Inject,args:[u]}]}]},r=s([e.Injectable(),(o=0,i=e.Inject(u),function(r,e){i(r,e,o)})],r)}(),p=function(){function r(r){this.errorService=r,this.key="_$ngx_error_boundary_global_error$_"}return r.prototype.ngOnInit=function(){var r=this;this.errors$=t.combineLatest([this.errorService.errors$,this.errorService.keys$]).pipe(n.map((function(e){var t=c(e,2),n=t[0],o=t[1];return r.zip(n,o)}))),this.isRetrying$=this.errorService.retryStatus$.pipe(n.map((function(r){return"end"!==r})))},r.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},r.prototype.zip=function(r,e){return Object.keys(e).reduce((function(e,t){var n;return i(i({},e),((n={})[t]=r[t],n))}),{})},r.prototype.getContext=function(r,e){return{$implicit:{message:r,key:e},retry$:this.isRetrying$}},r.ctorParameters=function(){return[{type:a}]},s([e.Input()],r.prototype,"fallback",void 0),s([e.Input()],r.prototype,"key",void 0),r=s([e.Component({selector:"ErrorBoundary",template:'<ng-container *ngIf="errors$ | async as errors; else content">\n <ng-container *ngIf="errors[key] as error; else content">\n <ng-container\n [ngTemplateOutlet]="fallback"\n [ngTemplateOutletContext]="getContext(error, key)"\n >\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n'})],r)}(),y=function(){function r(r){this.errorService=r}return r.prototype.onClick=function(){this.errorService.doRetry()},r.prototype.ngOnInit=function(){},r.ctorParameters=function(){return[{type:a}]},s([e.HostListener("click")],r.prototype,"onClick",null),r=s([e.Directive({selector:"[errorRetry]",exportAs:"retry"})],r)}(),l=function(){function r(r){this.errorService=r}return r.prototype.onClick=function(){this.errorService.dismiss(this.errorDismiss)},r.ctorParameters=function(){return[{type:a}]},s([e.Input()],r.prototype,"errorDismiss",void 0),s([e.HostListener("click")],r.prototype,"onClick",null),r=s([e.Directive({selector:"[errorDismiss]",exportAs:"dismiss"})],r)}(),f=function(){function r(){}return r=s([e.NgModule({declarations:[p,y,l],imports:[o.CommonModule],exports:[p,y,l],schemas:[e.CUSTOM_ELEMENTS_SCHEMA],providers:[{provide:u,useValue:"_$ngx_error_boundary_global_error$_"}]})],r)}();r.NgxErrorBoundaryComponent=p,r.NgxErrorBoundaryModule=f,r.NgxErrorBoundaryService=a,r.NgxErrorDismissDirective=l,r.NgxErrorRetryDirective=y,r.ɵa=u,Object.defineProperty(r,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-error-boundary.umd.min.js.map |
@@ -7,2 +7,3 @@ import { __decorate } from "tslib"; | ||
import { CommonModule } from "@angular/common"; | ||
import { GLOBAL_KEY } from "./ngx-error-boundary.token"; | ||
let NgxErrorBoundaryModule = class NgxErrorBoundaryModule { | ||
@@ -24,5 +25,11 @@ }; | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
providers: [ | ||
{ | ||
provide: GLOBAL_KEY, | ||
useValue: "_$ngx_error_boundary_global_error$_", | ||
}, | ||
], | ||
}) | ||
], NgxErrorBoundaryModule); | ||
export { NgxErrorBoundaryModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1lcnJvci1ib3VuZGFyeS8iLCJzb3VyY2VzIjpbImxpYi9uZ3gtZXJyb3ItYm91bmRhcnkubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pFLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQzNFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ3JFLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ3pFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQWdCL0MsSUFBYSxzQkFBc0IsR0FBbkMsTUFBYSxzQkFBc0I7Q0FBRyxDQUFBO0FBQXpCLHNCQUFzQjtJQWRsQyxRQUFRLENBQUM7UUFDUixZQUFZLEVBQUU7WUFDWix5QkFBeUI7WUFDekIsc0JBQXNCO1lBQ3RCLHdCQUF3QjtTQUN6QjtRQUNELE9BQU8sRUFBRSxDQUFDLFlBQV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JvckRpc21pc3NEaXJlY3RpdmUsXG4gIF0sXG4gIHNjaGVtYXM6IFtDVVNUT01fRUxFTUVOVFNfU0NIRU1BXSxcbiAgcHJvdmlkZXJzOiBbXG4gICAge1xuICAgICAgcHJvdmlkZTogR0xPQkFMX0tFWSxcbiAgICAgIHVzZVZhbHVlOiBcIl8kbmd4X2Vycm9yX2JvdW5kYXJ5X2dsb2JhbF9lcnJvciRfXCIsXG4gICAgfSxcbiAgXSxcbn0pXG5leHBvcnQgY2xhc3MgTmd4RXJyb3JCb3VuZGFyeU1vZHVsZSB7fVxuIl19 |
@@ -1,7 +0,9 @@ | ||
import { __decorate } from "tslib"; | ||
import { Injectable } from "@angular/core"; | ||
import { __decorate, __param } from "tslib"; | ||
import { Injectable, Inject } from "@angular/core"; | ||
import { Subject, BehaviorSubject, Observable, throwError, } from "rxjs"; | ||
import { filter, retryWhen, delay, catchError, tap, exhaustMap, } from "rxjs/operators"; | ||
import { GLOBAL_KEY } from "./ngx-error-boundary.token"; | ||
let NgxErrorBoundaryService = class NgxErrorBoundaryService { | ||
constructor() { | ||
constructor(token) { | ||
this.token = token; | ||
this.errorStore = {}; | ||
@@ -20,4 +22,6 @@ this.keyStore = {}; | ||
} | ||
showErrors(errors, key = "_$ngx_error_boundary_global_error$_") { | ||
this.errorStore = Object.assign({}, this.errorStore, { [key]: errors }); | ||
showErrors(errors, key = this.token) { | ||
this.errorStore = Object.assign({}, this.errorStore, { | ||
[key]: errors, | ||
}); | ||
this.keyStore = Object.assign({}, this.keyStore, { [key]: true }); | ||
@@ -68,6 +72,10 @@ this.errorsSubject.next(this.errorStore); | ||
}; | ||
NgxErrorBoundaryService.ctorParameters = () => [ | ||
{ type: String, decorators: [{ type: Inject, args: [GLOBAL_KEY,] }] } | ||
]; | ||
NgxErrorBoundaryService = __decorate([ | ||
Injectable() | ||
Injectable(), | ||
__param(0, Inject(GLOBAL_KEY)) | ||
], NgxErrorBoundaryService); | ||
export { NgxErrorBoundaryService }; | ||
//#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zY3JpYmVyOiBTdWJzY3JpYmVyPGFueT4pID0+IHtcbiAgICAgICAgY29uc3Qgc3ViID0gb2JzJFxuICAgICAgICAgIC5waXBlKFxuICAgICAgICAgICAgY2F0Y2hFcnJvcigoZXJyKSA9PiB7XG4gICAgICAgICAgICAgIC8vIENhdGNoIGVycm9yIGV2ZXJ5IHRpbWUgaXQgZW1pdHNcbiAgICAgICAgICAgICAgdGhpcy5yZXRyeVN0YXR1c1N1YmpldC5uZXh0KFwiZW5kXCIpO1xuICAgICAgICAgICAgICBjb25zdCByZWFkYWJsZU1lc3NhZ2UgPSBtZXNzYWdlIHx8IEpTT04uc3RyaW5naWZ5KGVycik7XG4gICAgICAgICAgICAgIHRoaXMuc2hvd0Vycm9ycyhyZWFkYWJsZU1lc3NhZ2UsIGtleSk7XG4gICAgICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKGVycik7XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIC8vcmV0cnkgbWF4IHRpbWVzXG4gICAgICAgICAgICByZXRyeVdoZW4oKGVycikgPT5cbiAgICAgICAgICAgICAgZXJyLnBpcGUoXG4gICAgICAgICAgICAgICAgZXhoYXVzdE1hcCgoKSA9PiB0aGlzLnJldHJ5Q2xpY2skKSxcbiAgICAgICAgICAgICAgICBkZWxheSgxMClcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIHRhcCgoeCkgPT4ge1xuICAgICAgICAgICAgICAvLyBTdWNjZXNzXG4gICAgICAgICAgICAgIHRoaXMuZGlzbWlzcyhrZXkpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICApXG4gICAgICAgICAgLnN1YnNjcmliZShzdWJzY3JpYmVyKTtcblxuICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgIHN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfTtcbiAgfVxuXG4gIGRpc21pc3Moa2V5Pzogc3Rya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XR1c1N1YmpldC5uZXh0KFwiZW5kXCIpO1xuICAgICAgICAgICAgICBjb25zdCByZWFkYWJsZU1lc3NhZ2UgPSBtZXNzYWdlIHx8IEpTT04uc3RyaW5naWZ5KGVycik7XG4gICAgICAgICAgICAgIHRoaXMuc2hvd0Vycm9ycyhyZWFkYWJsZU1lc3NhZ2UsIGtleSk7XG4gICAgICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKGVycik7XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIC8vcmV0cnkgbWF4IHRpbWVzXG4gICAgICAgICAgICByZXRyeVdoZW4oKGVycikgPT5cbiAgICAgICAgICAgICAgZXJyLnBpcGUoXG4gICAgICAgICAgICAgICAgZXhoYXVzdE1hcCgoKSA9PiB0aGlzLnJldHJ5Q2xpY2skKSxcbiAgICAgICAgICAgICAgICBkZWxheSgxMClcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIHRhcCgoeCkgPT4ge1xuICAgICAgICAgICAgICAvLyBTdWNjZXNzXG4gICAgICAgICAgICAgIHRoaXMuZGlzbWlzcyhrZXkpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICApXG4gICAgICAgICAgLnN1YnNjcmliZShzdWJzY3JpYmVyKTtcblxuICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgIHN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfTtcbiAgfVxuXG4gIGRpc21pc3Moa2V5Pzogc3RyaW5nKSB7XG4gICAgaWYgKCFrZXkpIHtcbiAgICAgIC8vIERpc21pcyBhbGxcbiAgICAgIHRoaXMuZXJyb3JTdG9yZSA9IHt9O1xuICAgICAgdGhpcy5rZXlTdG9yZSA9IHt9O1xuICAgICAgdGhpcy5lcnJvcnNTdWJqZWN0Lm5leHQoe30pO1xuICAgICAgdGhpcy5rZXlTdWJqZWN0Lm5leHQoe30pO1xuICAgIH1cbiAgICBkZWxldGUgdGhpcy5lcnJvclN0b3JlW2tleV07XG4gICAgZGVsZXRlIHRoaXMua2V5U3RvcmVba2V5XTtcbiAgICB0aGlzLmVycm9yc1N1YmplY3QubmV4dCh0aGlzLmVycm9yU3RvcmUpO1xuICAgIHRoaXMua2V5U3ViamVjdC5uZXh0KHRoaXMua2V5U3RvcmUpO1xuICB9XG5cbiAgZG9SZXRyeSgpIHtcbiAgICB0aGlzLnJldHJ5Q2xpY2tTdWJqZWN0Lm5leHQoKTtcbiAgfVxufVxuIl19 |
@@ -5,2 +5,3 @@ /** | ||
export * from './public-api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWVycm9yLWJvdW5kYXJ5LyIsInNvdXJjZXMiOlsibmd4LWVycm9yLWJvdW5kYXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0= | ||
export { GLOBAL_KEY as ɵa } from './lib/ngx-error-boundary.token'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWVycm9yLWJvdW5kYXJ5LyIsInNvdXJjZXMiOlsibmd4LWVycm9yLWJvdW5kYXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUM7QUFFN0IsT0FBTyxFQUFDLFVBQVUsSUFBSSxFQUFFLEVBQUMsTUFBTSxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcblxuZXhwb3J0IHtHTE9CQUxfS0VZIGFzIMm1YX0gZnJvbSAnLi9saWIvbmd4LWVycm9yLWJvdW5kYXJ5LnRva2VuJzsiXX0= |
@@ -7,2 +7,3 @@ import { __decorate } from "tslib"; | ||
import { CommonModule } from "@angular/common"; | ||
import { GLOBAL_KEY } from "./ngx-error-boundary.token"; | ||
var NgxErrorBoundaryModule = /** @class */ (function () { | ||
@@ -25,2 +26,8 @@ function NgxErrorBoundaryModule() { | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
providers: [ | ||
{ | ||
provide: GLOBAL_KEY, | ||
useValue: "_$ngx_error_boundary_global_error$_", | ||
}, | ||
], | ||
}) | ||
@@ -31,2 +38,2 @@ ], NgxErrorBoundaryModule); | ||
export { NgxErrorBoundaryModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1lcnJvci1ib3VuZGFyeS8iLCJzb3VyY2VzIjpbImxpYi9uZ3gtZXJyb3ItYm91bmRhcnkubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pFLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQzNFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ3JFLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQ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G5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtcbiAgICBOZ3hFcnJvckJvdW5kYXJ5Q29tcG9uZW50LFxuICAgIE5neEVycm9yUmV0cnlEaXJlY3RpdmUsXG4gICAgTmd4RXJyb3JEaXNtaXNzRGlyZWN0aXZlLFxuICBdLFxuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlXSxcbiAgZXhwb3J0czogW1xuICAgIE5neEVycm9yQm91bmRhcnlDb21wb25lbnQsXG4gICAgTmd4RXJyb3JSZXRyeURpcmVjdGl2ZSxcbiAgICBOZ3hFcnJvckRpc21pc3NEaXJlY3RpdmUsXG4gIF0sXG4gIHNjaGVtYXM6IFtDVVNUT01fRUxFTUVOVFNfU0NIRU1BXSxcbiAgcHJvdmlkZXJzOiBbXG4gICAge1xuICAgICAgcHJvdmlkZTogR0xPQkFMX0tFWSxcbiAgICAgIHVzZVZhbHVlOiBcIl8kbmd4X2Vycm9yX2JvdW5kYXJ5X2dsb2JhbF9lcnJvciRfXCIsXG4gICAgfSxcbiAgXSxcbn0pXG5leHBvcnQgY2xhc3MgTmd4RXJyb3JCb3VuZGFyeU1vZHVsZSB7fVxuIl19 |
@@ -1,8 +0,10 @@ | ||
import { __decorate } from "tslib"; | ||
import { Injectable } from "@angular/core"; | ||
import { __decorate, __param } from "tslib"; | ||
import { Injectable, Inject } from "@angular/core"; | ||
import { Subject, BehaviorSubject, Observable, throwError, } from "rxjs"; | ||
import { filter, retryWhen, delay, catchError, tap, exhaustMap, } from "rxjs/operators"; | ||
import { GLOBAL_KEY } from "./ngx-error-boundary.token"; | ||
var NgxErrorBoundaryService = /** @class */ (function () { | ||
function NgxErrorBoundaryService() { | ||
function NgxErrorBoundaryService(token) { | ||
var _this = this; | ||
this.token = token; | ||
this.errorStore = {}; | ||
@@ -23,4 +25,6 @@ this.keyStore = {}; | ||
var _a, _b; | ||
if (key === void 0) { key = "_$ngx_error_boundary_global_error$_"; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, _a[key] = errors, _a)); | ||
if (key === void 0) { key = this.token; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, | ||
_a[key] = errors, | ||
_a)); | ||
this.keyStore = Object.assign({}, this.keyStore, (_b = {}, _b[key] = true, _b)); | ||
@@ -74,4 +78,8 @@ this.errorsSubject.next(this.errorStore); | ||
}; | ||
NgxErrorBoundaryService.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: Inject, args: [GLOBAL_KEY,] }] } | ||
]; }; | ||
NgxErrorBoundaryService = __decorate([ | ||
Injectable() | ||
Injectable(), | ||
__param(0, Inject(GLOBAL_KEY)) | ||
], NgxErrorBoundaryService); | ||
@@ -81,2 +89,2 @@ return NgxErrorBoundaryService; | ||
export { NgxErrorBoundaryService }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtZXJyb3ItYm91bmRhcnkvIiwic291cmNlcyI6WyJsaWIvbmd4LWVycm9yLWJvdW5kYXJ5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUNMLE9BQU8sRUFDUCxlQUFlLEVBQ2YsVUFBVSxFQUNWLFVBQVUsR0FFWCxNQUFNLE1BQU0sQ0FBQztBQUNkLE9BQU8sRUFDTCxNQUFNLEVBQ04sU0FBUyxFQUNULEtBQUssRUFDTCxVQUFVLEVBQ1YsR0FBRyxFQUNILFVBQVUsR0FDWCxNQUFNLGdCQUFnQixDQUFDO0FBUXhCO0lBc0JFO1FBQUEsaUJBQWdCO1FBckJSLGVBQVUsR0FBRyxFQUFFLENBQUM7UUFDaEIsYUFBUSxHQUFHLEVBQUUsQ0FBQztRQUNkLGtCQUFhLE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iamVjdC5hc3NpZ24oe30sIHRoaXMua2V5U3RvcmUsIHsgW2tleV06IHRydWUgfSk7XG4gICAgdGhpcy5lcnJvcnNTdWJqZWN0Lm5leHQodGhpcy5lcnJvclN0b3JlKTtcbiAgICB0aGlzLmtleVN1YmplY3QubmV4dCh0aGlzLmtleVN0b3JlKTtcbiAgfVxuXG4gIGhhbmRsZUV4cGVjdGlvbihlcnJvck9wdGlvbjogSU5neEVycm9yT3B0aW9uID0ge30pIHtcbiAgICBjb25zdCB7IG1lc3NhZ2UsIGtleSB9ID0gZXJyb3JPcHRpb247XG4gICAgcmV0dXJuIChvYnMkKSA9PiB7XG4gICAgICByZXR1cm4gbmV3IE9ic2VydmFibGUoKHN1YnNjcmliZXI6IFN1YnNjcmliZXI8YW55PikgPT4ge1xuICAgICAgICBjb25zdCBzdWIgPSBvYnMkXG4gICAgICAgICAgLnBpcGUoXG4gICAgICAgICAgICBjYXRjaEVycm9yKChlcnIpID0+IHtcbiAgICAgICAgICAgICAgLy8gQ2F0Y2ggZXJyb3IgZXZlcnkgdGltZSBpdCBlbWl0c1xuICAgICAgICAgICAgICB0aGlzLnJldHJ5U3RhdHVzU3ViamV0Lm5leHQoXCJlbmRcIik7XG4gICAgICAgICAgICAgIGNvbnN0IHJlYWRhYmxlTWVzc2FnZSA9IG1lc3NhZ2UgfHwgSlNPTi5zdHJpbmdpZnkoZXJyKTtcbiAgICAgICAgICAgICAgdGhpcy5zaG93RXJyb3JzKHJlYWRhYmxlTWVzc2FnZSwga2V5KTtcbiAgICAgICAgICAgICAgcmV0dXJuIHRocm93RXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgLy9yZXRyeSBtYXggdGltZXNcbiAgICAgICAgICAgIHJldHJ5V2hlbigoZXJyKSA9PlxuICAgICAgICAgICAgICBlcnIucGlwZShcbiAgICAgICAgICAgICAgICBleGhhdXN0TWFwKCgpID0+IHRoaXMucmV0cnlDbGljayQpLFxuICAgICAgICAgICAgICAgIGRlbGF5KDEwKVxuICAgICAgICAgICAgICApXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgdGFwKCh4KSA9PiB7XG4gICAgICAgICAgICAgIC8vIFN1Y2Nlc3NcbiAgICAgICAgICAgICAgdGhpcy5kaXNtaXNzKGtleSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgIClcbiAgICAgICAgICAuc3Vic2NyaWJlKHN1YnNjcmliZXIpO1xuXG4gICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgIH07XG4gICAgICB9KTtcbiAgICB9O1xuICB9XG5cbiAgZGlzbWlzcyhrZXk/OiBzdHJpbmcpIHtcbiAgICBpZiAoIWtleSkge1xuICAgICAgLy8gRGlzbWlzIGFsbFxuICAgICAgdGhpcy5lcnJvclN0b3JlID0ge307XG4gICAgICB0aGlzLmtleVN0b3JlID0ge307XG4gICAgICB0aGlzLmVycm9yc1N1YmplY3QubmV4dCh7fSk7XG4gICAgICB0aGlzLmtleVN1YmplY3QubmV4dCh7fSk7XG4gICAgfVxuICAgIGRlbGV0ZSB0aGlzLmVycm9yU3RvcmVba2V5XTtcbiAgICBkZWxldGUgdGhpcy5rZXlTdG9yZVtrZXldO1xuICAgIHRoaXMuZXJyb3JzU3ViamVjdC5uZXh0KHRoaXMuZXJyb3JTdG9yZSk7XG4gICAgdGhpcy5rZXlTdWJqZWN0Lm5leHQodGhpcy5rZXlTdG9yZSk7XG4gIH1cblxuICBkb1JldHJ5KCkge1xuICAgIHRoaXMucmV0cnlDbGlja1N1YmplY3QubmV4dCgpO1xuICB9XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtZXJyb3ItYm91bmRhcnkvIiwic291cmNlcyI6WyJsaWIvbmd4L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b3JPcHRpb24gPSB7fSkge1xuICAgIGNvbnN0IHsgbWVzc2FnZSwga2V5IH0gPSBlcnJvck9wdGlvbjtcbiAgICByZXR1cm4gKG9icyQpID0+IHtcbiAgICAgIHJldHVybiBuZXcgT2JzZXJ2YWJsZSgoc3Vic2NyaWJlcjogU3Vic2NyaWJlcjxhbnk+KSA9PiB7XG4gICAgICAgIGNvbnN0IHN1YiA9IG9icyRcbiAgICAgICAgICAucGlwZShcbiAgICAgICAgICAgIGNhdGNoRXJyb3IoKGVycikgPT4ge1xuICAgICAgICAgICAgICAvLyBDYXRjaCBlcnJvciBldmVyeSB0aW1lIGl0IGVtaXRzXG4gICAgICAgICAgICAgIHRoaXMucmV0cnlTdGF0dXNTdWJqZXQubmV4dChcImVuZFwiKTtcbiAgICAgICAgICAgICAgY29uc3QgcmVhZGFibGVNZXNzYWdlID0gbWVzc2FnZSB8fCBKU09OLnN0cmluZ2lmeShlcnIpO1xuICAgICAgICAgICAgICB0aGlzLnNob3dFcnJvcnMocmVhZGFibGVNZXNzYWdlLCBrZXkpO1xuICAgICAgICAgICAgICByZXR1cm4gdGhyb3dFcnJvcihlcnIpO1xuICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAvL3JldHJ5IG1heCB0aW1lc1xuICAgICAgICAgICAgcmV0cnlXaGVuKChlcnIpID0+XG4gICAgICAgICAgICAgIGVyci5waXBlKFxuICAgICAgICAgICAgICAgIGV4aGF1c3RNYXAoKCkgPT4gdGhpcy5yZXRyeUNsaWNrJCksXG4gICAgICAgICAgICAgICAgZGVsYXkoMTApXG4gICAgICAgICAgICAgIClcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICB0YXAoKHgpID0+IHtcbiAgICAgICAgICAgICAgLy8gU3VjY2Vzc1xuICAgICAgICAgICAgICB0aGlzLmRpc21pc3Moa2V5KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgKVxuICAgICAgICAgIC5zdWJzY3JpYmUoc3Vic2NyaWJlcik7XG5cbiAgICAgICAgcmV0dXJuICgpID0+IHtcbiAgICAgICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH07XG4gIH1cblxuICBkaXNtaXNzKGtleT86IHN0cmluZykge1xuICAgIGlmICgha2V5KSB7XG4gICAgICAvLyBEaXNtaXMgYWxsXG4gICAgICB0aGlzLmVycm9yU3RvcmUgPSB7fTtcbiAgICAgIHRoaXMua2V5U3RvcmUgPSB7fTtcbiAgICAgIHRoaXMuZXJyb3JzU3ViamVjdC5uZXh0KHt9KTtcbiAgICAgIHRoaXMua2V5U3ViamVjdC5uZXh0KHt9KTtcbiAgICB9XG4gICAgZGVsZXRlIHRoaXMuZXJyb3JTdG9yZVtrZXldO1xuICAgIGRlbGV0ZSB0aGlzLmtleVN0b3JlW2tleV07XG4gICAgdGhpcy5lcnJvcnNTdWJqZWN0Lm5leHQodGhpcy5lcnJvclN0b3JlKTtcbiAgICB0aGlzLmtleVN1YmplY3QubmV4dCh0aGlzLmtleVN0b3JlKTtcbiAgfVxuXG4gIGRvUmV0cnkoKSB7XG4gICAgdGhpcy5yZXRyeUNsaWNrU3ViamVjdC5uZXh0KCk7XG4gIH1cbn1cbiJdfQ== |
@@ -5,2 +5,3 @@ /** | ||
export * from './public-api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWVycm9yLWJvdW5kYXJ5LyIsInNvdXJjZXMiOlsibmd4LWVycm9yLWJvdW5kYXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0= | ||
export { GLOBAL_KEY as ɵa } from './lib/ngx-error-boundary.token'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWVycm9yLWJvdW5kYXJ5LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LWVycm9yLWJvdW5kYXJ5LyIsInNvdXJjZXMiOlsibmd4LWVycm9yLWJvdW5kYXJ5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUM7QUFFN0IsT0FBTyxFQUFDLFVBQVUsSUFBSSxFQUFFLEVBQUMsTUFBTSxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcblxuZXhwb3J0IHtHTE9CQUxfS0VZIGFzIMm1YX0gZnJvbSAnLi9saWIvbmd4LWVycm9yLWJvdW5kYXJ5LnRva2VuJzsiXX0= |
@@ -1,3 +0,3 @@ | ||
import { __decorate } from 'tslib'; | ||
import { Injectable, Input, Component, HostListener, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { __decorate, __param } from 'tslib'; | ||
import { InjectionToken, Inject, Injectable, Input, Component, HostListener, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { BehaviorSubject, Subject, Observable, throwError, combineLatest } from 'rxjs'; | ||
@@ -7,4 +7,7 @@ import { tap, filter, catchError, retryWhen, exhaustMap, delay, map } from 'rxjs/operators'; | ||
const GLOBAL_KEY = new InjectionToken("global_key"); | ||
let NgxErrorBoundaryService = class NgxErrorBoundaryService { | ||
constructor() { | ||
constructor(token) { | ||
this.token = token; | ||
this.errorStore = {}; | ||
@@ -23,4 +26,6 @@ this.keyStore = {}; | ||
} | ||
showErrors(errors, key = "_$ngx_error_boundary_global_error$_") { | ||
this.errorStore = Object.assign({}, this.errorStore, { [key]: errors }); | ||
showErrors(errors, key = this.token) { | ||
this.errorStore = Object.assign({}, this.errorStore, { | ||
[key]: errors, | ||
}); | ||
this.keyStore = Object.assign({}, this.keyStore, { [key]: true }); | ||
@@ -71,4 +76,8 @@ this.errorsSubject.next(this.errorStore); | ||
}; | ||
NgxErrorBoundaryService.ctorParameters = () => [ | ||
{ type: String, decorators: [{ type: Inject, args: [GLOBAL_KEY,] }] } | ||
]; | ||
NgxErrorBoundaryService = __decorate([ | ||
Injectable() | ||
Injectable(), | ||
__param(0, Inject(GLOBAL_KEY)) | ||
], NgxErrorBoundaryService); | ||
@@ -186,2 +195,8 @@ | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
providers: [ | ||
{ | ||
provide: GLOBAL_KEY, | ||
useValue: "_$ngx_error_boundary_global_error$_", | ||
}, | ||
], | ||
}) | ||
@@ -198,3 +213,3 @@ ], NgxErrorBoundaryModule); | ||
export { NgxErrorBoundaryComponent, NgxErrorBoundaryModule, NgxErrorBoundaryService, NgxErrorDismissDirective, NgxErrorRetryDirective }; | ||
export { NgxErrorBoundaryComponent, NgxErrorBoundaryModule, NgxErrorBoundaryService, NgxErrorDismissDirective, NgxErrorRetryDirective, GLOBAL_KEY as ɵa }; | ||
//# sourceMappingURL=ngx-error-boundary.js.map |
@@ -1,3 +0,3 @@ | ||
import { __decorate, __read, __assign } from 'tslib'; | ||
import { Injectable, Input, Component, HostListener, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { __decorate, __param, __read, __assign } from 'tslib'; | ||
import { InjectionToken, Inject, Injectable, Input, Component, HostListener, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||
import { BehaviorSubject, Subject, Observable, throwError, combineLatest } from 'rxjs'; | ||
@@ -7,5 +7,8 @@ import { tap, filter, catchError, retryWhen, exhaustMap, delay, map } from 'rxjs/operators'; | ||
var GLOBAL_KEY = new InjectionToken("global_key"); | ||
var NgxErrorBoundaryService = /** @class */ (function () { | ||
function NgxErrorBoundaryService() { | ||
function NgxErrorBoundaryService(token) { | ||
var _this = this; | ||
this.token = token; | ||
this.errorStore = {}; | ||
@@ -26,4 +29,6 @@ this.keyStore = {}; | ||
var _a, _b; | ||
if (key === void 0) { key = "_$ngx_error_boundary_global_error$_"; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, _a[key] = errors, _a)); | ||
if (key === void 0) { key = this.token; } | ||
this.errorStore = Object.assign({}, this.errorStore, (_a = {}, | ||
_a[key] = errors, | ||
_a)); | ||
this.keyStore = Object.assign({}, this.keyStore, (_b = {}, _b[key] = true, _b)); | ||
@@ -77,4 +82,8 @@ this.errorsSubject.next(this.errorStore); | ||
}; | ||
NgxErrorBoundaryService.ctorParameters = function () { return [ | ||
{ type: String, decorators: [{ type: Inject, args: [GLOBAL_KEY,] }] } | ||
]; }; | ||
NgxErrorBoundaryService = __decorate([ | ||
Injectable() | ||
Injectable(), | ||
__param(0, Inject(GLOBAL_KEY)) | ||
], NgxErrorBoundaryService); | ||
@@ -203,2 +212,8 @@ return NgxErrorBoundaryService; | ||
schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||
providers: [ | ||
{ | ||
provide: GLOBAL_KEY, | ||
useValue: "_$ngx_error_boundary_global_error$_", | ||
}, | ||
], | ||
}) | ||
@@ -217,3 +232,3 @@ ], NgxErrorBoundaryModule); | ||
export { NgxErrorBoundaryComponent, NgxErrorBoundaryModule, NgxErrorBoundaryService, NgxErrorDismissDirective, NgxErrorRetryDirective }; | ||
export { NgxErrorBoundaryComponent, NgxErrorBoundaryModule, NgxErrorBoundaryService, NgxErrorDismissDirective, NgxErrorRetryDirective, GLOBAL_KEY as ɵa }; | ||
//# sourceMappingURL=ngx-error-boundary.js.map |
@@ -7,2 +7,3 @@ import { Observable } from "rxjs"; | ||
export declare class NgxErrorBoundaryService { | ||
private token; | ||
private errorStore; | ||
@@ -22,3 +23,3 @@ private keyStore; | ||
}>; | ||
constructor(); | ||
constructor(token: string); | ||
private showErrors; | ||
@@ -25,0 +26,0 @@ handleExpection(errorOption?: INgxErrorOption): (obs$: any) => Observable<any>; |
@@ -5,1 +5,2 @@ /** | ||
export * from './public-api'; | ||
export { GLOBAL_KEY as ɵa } from './lib/ngx-error-boundary.token'; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"INgxErrorOption":{"__symbolic":"interface"},"NgxErrorBoundaryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":22,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"showErrors":[{"__symbolic":"method"}],"handleExpection":[{"__symbolic":"method"}],"dismiss":[{"__symbolic":"method"}],"doRetry":[{"__symbolic":"method"}]}},"NgxErrorBoundaryComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"ErrorBoundary","template":"<ng-container *ngIf=\"errors$ | async as errors; else content\">\n <ng-container *ngIf=\"errors[key] as error; else content\">\n <ng-container\n [ngTemplateOutlet]=\"fallback\"\n [ngTemplateOutletContext]=\"getContext(error, key)\"\n >\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n"}]}],"members":{"fallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"zip":[{"__symbolic":"method"}],"getContext":[{"__symbolic":"method"}]}},"NgxErrorBoundaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"NgxErrorBoundaryComponent"},{"__symbolic":"reference","name":"NgxErrorRetryDirective"},{"__symbolic":"reference","name":"NgxErrorDismissDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":12}],"exports":[{"__symbolic":"reference","name":"NgxErrorBoundaryComponent"},{"__symbolic":"reference","name":"NgxErrorRetryDirective"},{"__symbolic":"reference","name":"NgxErrorDismissDirective"}],"schemas":[{"__symbolic":"reference","module":"@angular/core","name":"CUSTOM_ELEMENTS_SCHEMA","line":18,"character":12}]}]}],"members":{}},"NgxErrorRetryDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[errorRetry]","exportAs":"retry"}]}],"members":{"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":8,"character":3},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"NgxErrorDismissDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[errorDismiss]","exportAs":"dismiss"}]}],"members":{"errorDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":10,"character":3},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}]}}},"origins":{"INgxErrorOption":"./lib/ngx-error-boundary.service","NgxErrorBoundaryService":"./lib/ngx-error-boundary.service","NgxErrorBoundaryComponent":"./lib/ngx-error-boundary.component","NgxErrorBoundaryModule":"./lib/ngx-error-boundary.module","NgxErrorRetryDirective":"./lib/ngx-error-retry.directive","NgxErrorDismissDirective":"./lib/ngx-error-dismiss.directive"},"importAs":"ngx-error-boundary"} | ||
{"__symbolic":"module","version":4,"metadata":{"INgxErrorOption":{"__symbolic":"interface"},"NgxErrorBoundaryService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":46,"character":15},"arguments":[{"__symbolic":"reference","name":"ɵa"}]}]],"parameters":[{"__symbolic":"reference","name":"string"}]}],"showErrors":[{"__symbolic":"method"}],"handleExpection":[{"__symbolic":"method"}],"dismiss":[{"__symbolic":"method"}],"doRetry":[{"__symbolic":"method"}]}},"NgxErrorBoundaryComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"ErrorBoundary","template":"<ng-container *ngIf=\"errors$ | async as errors; else content\">\n <ng-container *ngIf=\"errors[key] as error; else content\">\n <ng-container\n [ngTemplateOutlet]=\"fallback\"\n [ngTemplateOutletContext]=\"getContext(error, key)\"\n >\n </ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n"}]}],"members":{"fallback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"zip":[{"__symbolic":"method"}],"getContext":[{"__symbolic":"method"}]}},"NgxErrorBoundaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"NgxErrorBoundaryComponent"},{"__symbolic":"reference","name":"NgxErrorRetryDirective"},{"__symbolic":"reference","name":"NgxErrorDismissDirective"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":13,"character":12}],"exports":[{"__symbolic":"reference","name":"NgxErrorBoundaryComponent"},{"__symbolic":"reference","name":"NgxErrorRetryDirective"},{"__symbolic":"reference","name":"NgxErrorDismissDirective"}],"schemas":[{"__symbolic":"reference","module":"@angular/core","name":"CUSTOM_ELEMENTS_SCHEMA","line":19,"character":12}],"providers":[{"provide":{"__symbolic":"reference","name":"ɵa"},"useValue":"_$ngx_error_boundary_global_error$_"}]}]}],"members":{}},"NgxErrorRetryDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[errorRetry]","exportAs":"retry"}]}],"members":{"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":8,"character":3},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}],"ngOnInit":[{"__symbolic":"method"}]}},"NgxErrorDismissDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1},"arguments":[{"selector":"[errorDismiss]","exportAs":"dismiss"}]}],"members":{"errorDismiss":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":10,"character":3},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"NgxErrorBoundaryService"}]}]}},"ɵa":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":2,"character":30},"arguments":["global_key"]}},"origins":{"INgxErrorOption":"./lib/ngx-error-boundary.service","NgxErrorBoundaryService":"./lib/ngx-error-boundary.service","NgxErrorBoundaryComponent":"./lib/ngx-error-boundary.component","NgxErrorBoundaryModule":"./lib/ngx-error-boundary.module","NgxErrorRetryDirective":"./lib/ngx-error-retry.directive","NgxErrorDismissDirective":"./lib/ngx-error-dismiss.directive","ɵa":"./lib/ngx-error-boundary.token"},"importAs":"ngx-error-boundary"} |
{ | ||
"name": "ngx-error-boundary", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Zhentian Wan", |
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
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
200125
36
1430