Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
request(operation) {
console.log(operation);
return new Observable(observer => {
this.promiseWorker.postMessage(operation)
.then(data => {
console.log('DATA', data);
observer.next(data);
observer.complete();
})
.catch(observer.error.bind(observer));
});
}
}
export function fromPromise(promise: Promise): Observable {
return new Observable(observer => {
promise
.then((value: T) => {
observer.next(value);
observer.complete();
})
.catch(observer.error.bind(observer));
});
}
function fromError(errorValue) {
return new Observable(function (observer) {
observer.error(errorValue);
});
}
function transformOperation(operation) {
export function fromError(errorValue: any): Observable {
return new Observable(observer => {
observer.error(errorValue);
});
}
function fromPromise(promise) {
return new Observable(function (observer) {
promise
.then(function (value) {
observer.next(value);
observer.complete();
})
.catch(observer.error.bind(observer));
});
}
function fromError(errorValue) {