2018-11-22 16:41:46 +01:00
|
|
|
import { hostReportError } from './hostReportError';
|
|
|
|
export const subscribeToPromise = (promise) => (subscriber) => {
|
|
|
|
promise.then((value) => {
|
|
|
|
if (!subscriber.closed) {
|
|
|
|
subscriber.next(value);
|
|
|
|
subscriber.complete();
|
|
|
|
}
|
|
|
|
}, (err) => subscriber.error(err))
|
|
|
|
.then(null, hostReportError);
|
|
|
|
return subscriber;
|
|
|
|
};
|
2019-06-04 14:29:48 +02:00
|
|
|
//# sourceMappingURL=subscribeToPromise.js.map
|