You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
I have another one called subscribeCallback, which "subscribes" an observable to a node-style callback:
functionsubscribeCallback(observable,callback){returnobservable.// Only take the last item, to ensure we aren't calling `callback`// multiple times.last().subscribe(function(x){callback(null,x);},function(err){callback(err);});};
My use case is that I'm working with a library where we're trying to keep all of our interfaces node-standard (callbacks or streams), but I'd still like to use RxJS for implementations. So I have a lot of functions that look like this
functionfetchAThing(callback){// Bridge another node-style callback function to an Observablevargetter=Observable.fromNodeCallback(getSomething);// Do my observable stuffvarobs=getter.map(...).filter(...);// Bridge back to node-style callbackssubscribeCallback(obs,callback);}functionfetchABunchOfThings(){varobs=RxNode.fromReadbleStream(getAStreamOfThings());// Do my observable stuffvarobs2=obs.map(...).filter(...);// Bridge back to a node streamreturntoReadableStream(obs2);}
Is this something that you would see as in the scope of the RxNode library? If so, I can look at submitting a pull-request.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I put together a method for converting an Observable to a readable stream. It looks something like this:
I have another one called
subscribeCallback
, which "subscribes" an observable to a node-style callback:My use case is that I'm working with a library where we're trying to keep all of our interfaces node-standard (callbacks or streams), but I'd still like to use RxJS for implementations. So I have a lot of functions that look like this
Is this something that you would see as in the scope of the RxNode library? If so, I can look at submitting a pull-request.
The text was updated successfully, but these errors were encountered: