UNPKG

@politie/sherlock-rxjs

Version:

An extension to Sherlock that provides interop with RxJS.

2 lines 648 B
import{_internal as n,atom as r,ErrorWrapper as t}from"@politie/sherlock";import{Observable as o}from"rxjs";function e(r,t){return new o((function(o){return n.Reactor.create(r,(function(n){return o.next(n)}),t,(function(){return o.closed||o.complete()}))}))}function u(n){var o,e=r.unresolved();return e.connected$.react((function(){e.connected&&!o&&(o=n.subscribe({next:function(n){return e.set(n)},error:function(n){return e.setFinal(new t(n))},complete:function(){return e.setFinal(e.getState())}})),!e.connected&&o&&(o.unsubscribe(),o=void 0)})),e}export{u as fromObservable,e as toObservable}; //# sourceMappingURL=sherlock-rxjs.esm.min.js.map