#mergeMap ain't returning the result of a promise

4 messages · Page 1 of 1 (latest)

spare bramble
#

Any RxJS expert?

Need help with this code: https://github.com/kasir-barati/nestjs-materials/blob/32fd2719a7506303626c0651415988384ab5e02e/microservices/grpc/apps/file-upload/src/app/services/app.service.ts#L58

My fileService is empty even though I was expecting that this line would return it: https://github.com/kasir-barati/nestjs-materials/blob/32fd2719a7506303626c0651415988384ab5e02e/microservices/grpc/apps/file-upload/src/app/services/app.service.ts#L50

Any comment how I can get this RxJS part working?

BTW I know mixing async and observables ain't the brightest idea ever and I am open for suggestion.

carmine plover
#

I've been trying to recreate your issue, but have not been able to. My best guess is that there's some scoping weirdness going on between fileService (the parameter) and fileService the variable.

Maybe renaming the fileService variable on line 33 will help solve the issue.

https://github.com/kasir-barati/nestjs-materials/blob/32fd2719a7506303626c0651415988384ab5e02e/microservices/grpc/apps/file-upload/src/app/services/app.service.ts#L33

GitHub

NestJS tips, tricks, Notes, Things which are not in doc and I used to figure them out and use them - kasir-barati/nestjs-materials

spare bramble
#

Yeah, actually that was the issue 🤦‍♂️

#

Thanks for taking the time to go through my code. Appreciate it 💚