Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value(...args: any[]) {
const wrappedObservable: Observable = wrap(
this,
methodName,
opts
).apply(this, args);
return new Observable((observer: Observer) => {
const wrappedSubscription = wrappedObservable.subscribe({
next: (x: any) => {
observer.next(opts.resultTransform ? x[opts.resultTransform] : x);
if (opts.resultFinalPredicate && x[opts.resultFinalPredicate]) {
observer.complete();
}
},
error: (err: any) => {
observer.error(err);
},
complete: () => {