#rxjs
14 messages · Page 1 of 1 (latest)
it is not mandatory
so basically with rxjs i can do this
getAllUsers(): Observable<User[]> {
return from(this.usersRepository.find()).pipe(
catchError((err) =>
throwError(() => {
this.logger.error()
throw new InternalServerErrorException('Could not fetch users.');
}),
),
);
}
While with normal async i can do this
async getAllUsers(): Promise<User[]> {
return this.usersRepository.find();
}
So as per this, i understood that i can handle the errors in a better way with rxjs so only this is the pros of rxjs or there is any other??
I'm not that into rxjs so I can't tell much about the 'special benifits'
It just another tool that you can use for promises on steroids (as they say)
You can do much more than just error handling with it
I guess they are pretty common in angular world
ohh alright got it
its just like effects.ts ?
not sure
rxjs came first tho
Debunking common misconceptions about Effect's performance, complexity, and use cases.
they are not the same
Effect is basically RxJS + Result pattern (in my short experience with it)