@equinor/fusion-observable
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -5,3 +5,3 @@ export class ActionError extends Error { | ||
constructor(action, cause, msg) { | ||
super(msg ?? cause.message, { cause }); | ||
super(msg ?? cause.message); | ||
this.action = action; | ||
@@ -8,0 +8,0 @@ this.cause = cause; |
@@ -17,7 +17,5 @@ import { from, fromEvent, Observable, of, timer } from 'rxjs'; | ||
} | ||
subscriber.add(action$ | ||
.pipe(filterAction(ActionType.CANCEL)) | ||
.subscribe((action) => { | ||
subscriber.add(action$.pipe(filterAction(ActionType.CANCEL)).subscribe(() => { | ||
if (!controller.signal.aborted) { | ||
controller.abort(action.payload); | ||
controller.abort(); | ||
} | ||
@@ -24,0 +22,0 @@ subscriber.complete(); |
@@ -11,3 +11,3 @@ var RequestErrorType; | ||
constructor(type, message, cause) { | ||
super(message, { cause: cause }); | ||
super(message); | ||
this.type = type; | ||
@@ -14,0 +14,0 @@ this.cause = cause; |
@@ -44,3 +44,3 @@ import { asyncScheduler, firstValueFrom, Observable, Subscription } from 'rxjs'; | ||
case ActionType.CANCEL: | ||
throw new QueryError(QueryError.TYPE.ABORT, 'request was canceled', new Error(payload)); | ||
throw new QueryError(QueryError.TYPE.ABORT, 'request was canceled', new Error(String(payload))); | ||
} | ||
@@ -47,0 +47,0 @@ return payload; |
@@ -1,4 +0,4 @@ | ||
import { OperatorFunction } from 'rxjs'; | ||
import type { OperatorFunction } from 'rxjs'; | ||
import { Action, ActionType, ExtractAction } from '../types'; | ||
export declare const filterAction: <TAction extends Action<string>, TType extends ActionType<TAction>>(...type: TType[]) => OperatorFunction<TAction, Extract<TAction, Action<TType>>>; | ||
export default filterAction; |
{ | ||
"name": "@equinor/fusion-observable", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "WIP", | ||
@@ -75,3 +75,3 @@ "private": false, | ||
}, | ||
"gitHead": "a36ad57b4ec0a8f442602ac77c612caed796c6c5" | ||
"gitHead": "ebc05b53558f01224c1c294b1f96fc110324ef3b" | ||
} |
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
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
124485
736