-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace Promises with Observables #453
Comments
Please speak for yourself. I want promises, where they make sense and that is in 99% of TypeScript/ JavaScript code being written. They are an integral part of Node/ JavaScript to make use of JavaScript's event loop in order to stop code from blocking processing.
Not using Promises in TypeScript/JavaScript won't make the code more object oriented. There is no such thing as "async threads" in JavaScript. In fact, Promises or async/ await code is exactly what makes JavaScript so simple to use. Much better than the old days where there were only callbacks.
Nothing is hardwired. It's how JavaScript works. Offering Observables is not going to make any JavaScript code more efficient or better. Let's also take a step back. Observables are part of event management. i.e. certain objects can listen or produce events via working with observables. It's called reactive programming. It is a different paradigm than OOP, whereas OOP can make use of reactivity. What you are asking for is reactive features to Mongoose, which Mongoose itself doesn't support (maybe, more below). Remember, this package (nestjs-typegoose) is a wrapper to get Typegoose working in NestJS and Typegoose is a wrapper for Mongoose. If anything, you should be asking the Mongoose team for this change. And, I'll bet they'll basically ignore it. Btw, there is a "bit" of reactive programming in Mongoose with "watching". https://mongoosejs.com/docs/api.html#connection_Connection-watch Or with their hooks system within Middleware: https://mongoosejs.com/docs/middleware.html Your ask here is incorrectly placed as mentioned above. And, also instead of thinking you know the solution is to work with Observables, you might want to go to a place like StackOverflow/ StackExchange and present your current challenge and hopefully get people with a lot of knowledge to reply. I'll bet you a beer, they don't end up with saying some package will need to change and offer Observables to solve your problem. Scott |
Observables were the defacto standard for http in 2016 and now the STANDARD
its nice to see a fixture for nestJS for typegoose
I thought this Promise decision was typegoose related but it is not
typegoose/typegoose#631
Can Promises be ditched for Observables?
this is what I would like to see returning an Observable to the front end
Any assist and help is appreciated
can we have Observables please?
The text was updated successfully, but these errors were encountered: