#Rxjs

2 messages · Page 1 of 1 (latest)

tulip grove
#

Hello there I've been using nestjs for a while now and to this day Am still confused on why nestjs trying to force rxjs into everything like something as simple as a request response on the http module , so my question here is am I missing something here ? Is there some very cool use case of it that I just dont get ? I mean what is even an observerable boolean on the guard
I only used the observervables on sse and interceptors

amber plaza
#

In the case of the HTTP module, the code for adding in retries or handling recurring responses via observables in pretty slick and clean to work with, but if you really don't like observables you can always just firstFrom or lastFrom the request and convert it into a promise.

For guards, the Observable is there in the case that people might be using things like an HTTP request, or some other observable creator, in the guard and want to return that directly. It's just there for the option and you do not have to do it.

Hell, I use an observable in my OrGuard to allow complex guard sets to run and return a possible response. It's there for the option, and certainly not the only way to do things. In the case of WebSockets and Microservices, they certainly make some sense with the multiple responses that can come from the RPC server, and as interceptors use a point-cut, the observable makes it easy to manage the use of